Matlab add text to the outside of the picture

How to add text to the right of the picture? I want to resize the plot to leave an empty space on the right and add some information there.

Thank!!

+5
source share
2 answers

If you want to put this text inside a legend, you can do:

legend('Some quick information','location','EastOutside')

This is the easiest. However, for more control, you can place the text box inside the picture window:

MyBox = uicontrol('style','text')
set(MyBox,'String','Here is a lot more information')

and move it with:

set(MyBox,'Position',[xpos,ypos,xsize,ysize])
+15
source

Try this for short text:

plot(1:5);
text(5.05, 2.5, 'outside', 'clipping', 'off');

Or this solution for more complex annotations:

http://radio.feld.cvut.cz/matlab/techdoc/creating_plots/chaxes6.html

+3
source

All Articles