【问题标题】:Printing a MATLAB plot in exact dimensions on paper在纸上打印精确尺寸的 MATLAB 图
【发布时间】:2011-04-05 18:47:07
【问题描述】:

我有一个图需要在纸上以精确的尺寸打印出来,因为它是按比例绘制的,并且可以根据它在纸上测量一些东西。最简单(有可能)的方法是什么?

【问题讨论】:

    标签: matlab printing plot


    【解决方案1】:

    编辑

    %# create some plot, and make axis fill entire figure
    plot([0 5 0 5], [0 10 10 0]), axis tight
    set(gca, 'Position',[0 0 1 1])
    
    %# set size of figure's "drawing" area on screen
    set(gcf, 'Units','centimeters', 'Position',[0 0 5 10])
    
    %# set size on printed paper
    %#set(gcf, 'PaperUnits','centimeters', 'PaperPosition',[0 0 5 10])
    %# WYSIWYG mode: you need to adjust your screen's DPI (*)
    set(gcf, 'PaperPositionMode','auto')
    
    %# save as TIFF
    print -dtiff -r0 out.tiff
    

    (*):http://www.mathworks.com/help/matlab/creating_plots/printing-images.html

    【讨论】:

    • 嗨,Amro。谢谢回答。好的,我明白了上面的部分......然后呢?
    • @Amro - 是的,我想我什至在寻找它时偶然发现了那个页面。但它只处理屏幕/纸张上的图像比例。我需要一种以厘米为单位指定的方法,例如,我希望图像在纸上输出多大(我有一个非常大的绘图仪可供使用,并希望绘制一些 50x100cm 的图表 - 但它们需要正好是 50x100cm,因为学生会从上面读出数值)。
    • @Rook:您是否也可以尝试使用 PaperPositionMode=auto 的其他方法(在自定义显示器的 DPI 设置之后)?还要确保使用 TIFF 图像作为输出(由于某种原因 EPS/PDF 似乎有点大)
    • @Amro - 这种方法有效...... 5x10 cm 正好在纸上。感谢 Amro 的所有帮助。这对我来说非常重要。与手动配置所有这些打印参数相比,它将为我节省大量时间。
    猜你喜欢
    • 2018-05-06
    • 1970-01-01
    • 1970-01-01
    • 2014-09-04
    • 2023-04-03
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多