Matlab add text to the outside of figure

*爱你&永不变心* 提交于 2019-12-06 03:30:28

问题


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!!


回答1:


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])



回答2:


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



来源:https://stackoverflow.com/questions/10525890/matlab-add-text-to-the-outside-of-figure

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!