设置图表尺寸
我想做的就是让宽度更大,高度更小。我只是在绘制栅格图,但这个问题适用于任何 MATLAB figure
。我可以在创建图形时直接使用图形手动调整它的大小,但我希望程序首先以正确的大小吐出它。
All I want to do is make the width greater and the height smaller. I'm just doing raster plots but this question applies to any MATLAB figure
. I can manually resize it using the figure directly when it's created but I want the program to spit it out in the right size to start with.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
可为
figure
设置的属性参考这里。然后你可以使用:
The properties that can be set for a
figure
is referenced here.You could then use:
将其写为一行:
Write it as a one-liner:
这会将图形保存为指定的尺寸
This saves the figure in the dimensions specified
我设法通过以下序列获得了良好的结果(在开始时运行 Matlab 两次):
I managed to get a good result with the following sequence (run Matlab twice at the beginning):
不同的方法。
在
figure()
调用中指定属性或在h =figure()
之后修改图窗句柄属性。这将根据标准化单位创建全屏图形。
figure('units','normalized','outerposition',[0 0 1 1])
units
属性可以调整为英寸、厘米、像素等。请参阅
figure
文档。A different approach.
On the
figure()
call specify properties or modify the figure handle properties afterh = figure()
.This creates a full screen figure based on normalized units.
figure('units','normalized','outerposition',[0 0 1 1])
The
units
property can be adjusted to inches, centimeters, pixels, etc.See
figure
documentation.