如何设置绘图窗口的窗口大小?

发布于 2024-07-14 07:07:55 字数 275 浏览 4 评论 0原文

是否可以设置绘图窗口(图)的窗口大小/位置?

plot(0:20, sin(0:20))

或者是否有其他可能更改 print() 命令的大小?

print('aa.png', '-dpng')

因为 -Sxsize,ysize 参数不会改变任何内容。 写入的图片 (aa.png) 的大小始终与绘图窗口的大小相同。

我正在使用 Octave 3.0。

Is it possible to set the window size / position of a plot window (figure)?

plot(0:20, sin(0:20))

Or is there any other possibility to change the size of the print() command?

print('aa.png', '-dpng')

Because the -Sxsize,ysize parameter doesn't change anything. The size of the written picture (aa.png) has always the same size as the plot window.

I'm using Octave 3.0.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

樱花坊 2024-07-21 07:07:55

是的,有可能:

figure(1, 'position',[startx,starty,width,height]);
plot(0:20,sin(0:20));

[startx,starty] 是图形(窗口)左下角的坐标。

您还可以使用打印功能的分辨率选项

print('aa.png','-dpng','-r300');

我想第一个解决方案可能会更好......

问候

Yes, it is possible:

figure(1, 'position',[startx,starty,width,height]);
plot(0:20,sin(0:20));

[startx,starty] are the coordinates for the lower left corner of your figure (window).

You can also use the resolution option of the print function

print('aa.png','-dpng','-r300');

I guess the first solution might be better...

Regards

究竟谁懂我的在乎 2024-07-21 07:07:55

如果你想最大化,可以使用下面的代码:

figure(1,"position",get(0,"screensize"))

You can use the code below if you want to maximize:

figure(1,"position",get(0,"screensize"))
空气里的味道 2024-07-21 07:07:55

从 Octave 版本 4.2.2 开始,如 Janusz Lenar 所指出的,以下内容有效:

print('filename.png', '-dpng', '-S1280,720');

它将数字缩放为创建 1280x720 像素图像。

As of octave version 4.2.2, the following works, as pointed out by Janusz Lenar:

print('filename.png', '-dpng', '-S1280,720');

Which scales the figure to create a 1280x720 pixel image.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文