将图形另存为eps文件时,Matlab会切断颜色图标签 [英] When saving a figure as eps file, Matlab cuts off colormap labels

查看:177
本文介绍了将图形另存为eps文件时,Matlab会切断颜色图标签的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个使用带有颜色条的contourf生成的图形.我的大多数图表都很好,但是当颜色栏上的值的顺序为10^{-3}时,数字0.005等将由颜色栏写入,或者x10^{-3}会被写入顶部.

I have a figure generated using contourf with a colorbar. Most of my plots are fine, but when the values on the colorbar are of the order 10^{-3}, either the numbers 0.005 etc are written by the colorbar, or x10^{-3} is written at the top.

在这两种情况下,标签的一部分都被切除-在x10^{-3}中的3或在0.005中的5的一半.

In both cases, part of the label gets cut off - either the 3 in x10^{-3} or half of the 5 in 0.005.

我可以使用

set(gca, 'ActivePositionProperty', 'OuterPosition')

对于屏幕上的图形,但我需要将其保存为eps格式.当我这样做时,3(或5)再次被切断!

for the figure onscreen, but I need to save it in eps format. When I do this, the 3 (or 5) is cut off again!

如果我手动拉动图形窗口的右下角使其变大,我也可以解决此问题.但是,与图本身相比,这会更改轴标签等的大小,以使它们与我所有其他图形(即我未调整大小的图形)不同.

I can also fix this if I manually pull the bottom right corner of the figure window to make it larger. But this changes the sizes of the axis labels etc in comparison to the plot itself so that they're different to all my other figures, i.e. the figures that I don't resize.

有什么建议吗?

推荐答案

以前的建议部分正确.这是我所做的:

The former suggestion is partly correct. Here is what i did:

  1. 将图形和纸张单位都设置为相同的尺寸(数字有像素,没有点!)

  1. set both, figure and paper units, to the same measure (figure has pixels, not points!)

set(gcf,'Units','points')
set(gcf,'PaperUnits','points') 

  • 执行与之前建议相同的操作:

  • do the same as suggested before:

    size = get(gcf,'Position');
    size = size(3:4);
    set(gcf,'PaperSize',size)
    

  • 现在的事情是,就像我的情况一样,它可能会从纸上移开,所以重新放上

  • the thing now is, that it might be shifted off the paper, as in my case, so put it back on

    set(gcf,'PaperPosition',[0,0,size(1),size(2)])
    

  • 我不确定[0,0]的偏移量,但是什么是单点截断:)

    I am not sure about the offset of [0,0], but what is a single point cut off :)

    这篇关于将图形另存为eps文件时,Matlab会切断颜色图标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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