【问题标题】:PaperPosition and PaperSize is ther some simple way to calculate dependencyPaperPosition 和 Paper Size 是否有一些简单的方法来计算依赖性
【发布时间】:2012-05-24 22:23:16
【问题描述】:

我使用 matlab 来生成 pdf 文件中的图。 pdf 中的这些图应该具有正确的大小,因此我使用 PaperSize。然后我必须用正确的 PaperPosition 定位绘图。问题是matlab使用一些奇怪的方程来计算页面上绘图的位置。所以情节定位是用参数不断拍摄而不是计算它。例如:

set(gcf, 'PaperPosition', [-0.3 -0 7.2 3.1]); %Position the plot further to the left and down. Extend the plot to fill entire paper.[left bottom width height]
set(gcf, 'PaperSize', [6.5 3]); %Keep the paper size [width height]     

你知道matlab是如何计算这个位置的吗?

【问题讨论】:

标签: matlab plot


【解决方案1】:

我认为默认情况下纸张位置以英寸为单位。您可以使用以下命令进行检查:

get(gcf,'PageUnits')

您还可以检查图形显示的单位,默认情况下应该是像素。

get(gcf,'Units')

将它们更改为相同的比例,然后使用

设置位置
set(gcf,'PaperPosition',[x y width height])
set(gcf,'Position',[x y width height])

你至少应该有相同的尺寸。

【讨论】:

    猜你喜欢
    • 2012-05-24
    • 2018-01-30
    • 2023-03-28
    • 2010-11-14
    • 1970-01-01
    • 2014-03-10
    • 2020-05-17
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多