Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Matlab add text to the outside of figure [closed]

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

Thanks!!

like image 433
user1083320 Avatar asked Dec 01 '22 06:12

user1083320


2 Answers

If you want to put that text inside of a legend you can do:

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

That is easiest. For more control though, you can put a text box inside the figure window:

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

and move it around with:

set(MyBox,'Position',[xpos,ypos,xsize,ysize])
like image 113
zachd1_618 Avatar answered Dec 05 '22 16:12

zachd1_618


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

like image 29
Alfredo Capobianchi Avatar answered Dec 05 '22 17:12

Alfredo Capobianchi