Matlab在图的外部添加文本 [英] Matlab add text to the outside of figure

查看:979
本文介绍了Matlab在图的外部添加文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在图的右侧添加文本?我想调整图的大小,在右侧留一些空白,并在其中添加一些信息.

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.

谢谢!

推荐答案

如果要将文本放在图例中,可以执行以下操作:

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

这篇关于Matlab在图的外部添加文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆