I want to indicate the meaning of different text colors in my plot in a textbox.
Here a sample code:
figure;
bar([1,2,3])
ylim([0 5]); text(1,2,'{\color{blue} apples} {\color{red} pears}');
annotation('textbox',[.2 .6 .3 .3],'String',{'yes','no'},'FitBoxToText','on' );
All I'm looking for is an adequate symbol such as a long bold line or a square to use it as a color marker in my textbox in front of 'yes' and 'no'. Similar to the colored lines in a legend. How do I implement this in a MATLAB textbox?
Note: None of the special characters from the MATLAB webpage seems to be of use for me.


