保存到文件时,八度音阶未包含绘图的一部分 [英] Octave failing to include parts of a plot when saved to file

查看:89
本文介绍了保存到文件时,八度音阶未包含绘图的一部分的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个非常基本的自定义boxplot函数:

I have a very basic custom boxplot function:

function myboxplot(LPercentile, Median, RPercentile, Height, LineWidth, BoxHeight, MarkerColour, MarkerSize)
  hold on
  plot([LPercentile, RPercentile], [Height, Height], 'linewidth', LineWidth, 'color', 'k', 'linestyle', '-');
  plot([LPercentile, LPercentile], [Height - BoxHeight/2, Height + BoxHeight/2], 'linewidth', LineWidth,  'color', 'k', 'linestyle', '-');
  plot([RPercentile, RPercentile], [Height - BoxHeight/2, Height + BoxHeight/2], 'linewidth', LineWidth,  'color', 'k', 'linestyle', '-');  
  plot(Median, Height, 'marker', 'o', 'markersize', MarkerSize, 'markeredgecolor', 'k', 'markerfacecolor', MarkerColour);    
  hold off
end

当我按预期使用它时,

>> myboxplot(1,2,3,1,3,1,'g',20); hold on
>> myboxplot(2,3,5,3,3,1,'r',20); hold off
>> axis([0,6,0,4]);

它在我的八度音程中产生了预期的结果:

it produces the expected result within my octave session:

              b&b ;              nbsp; nbsp; a href ="https://i.stack.imgur.com/J7gyB.png" rel ="nofollow noreferrer">

                                                

但是当我尝试保存到文件时:

But when I attempt to save to a file:

>> saveas(gcf,'out.pdf','pdf');

它惨败:

              b&b ;              &bsp; a href ="https://i.stack.imgur.com/WVQCN.png" rel ="nofollow noreferrer">

                                                

无论输出格式如何(至少在pdf和png之间),都会发生这种情况.
这是一个错误吗?是否有解决方法以使线条可见?
(注意:我也在matlab中尝试过此代码,并且matlab按预期方式保存了文件)


(使用: GNU Octave版本:4.0.3 GNU Octave许可证:GNU通用公共许可证 操作系统:Linux 3.13.0-37-generic#64-Ubuntu SMP Mon Sep 22 21:28:38 UTC 2014 x86_64)
更新:Windows上的Octave 4.0.3产生正确的输出,因此,这绝对是Linux上的"bug" 错误.我将在八度音阶跟踪器上提交一个错误,但是如果有人同时知道任何解决方法,我将非常感激.

This happens regardless of output format (at least between pdf and png).
Is this a bug? Is there a workaround to make the lines visible?
(Note: I have also tried this code in matlab, and matlab saves the file as intended)


(using: GNU Octave Version: 4.0.3 GNU Octave License: GNU General Public License Operating System: Linux 3.13.0-37-generic #64-Ubuntu SMP Mon Sep 22 21:28:38 UTC 2014 x86_64 )
UPDATE: Octave 4.0.3 on windows produces the right output, so this is definitely a "bug" bug on linux. I will be submitting a bug on the octave tracker, but if anyone knows of any workarounds in the meantime I would be very grateful.

推荐答案

这确实是与octave用于将openGL图形转换为Postscript的库之一有关的真正错误,而不是根据提交八度错误(错误#49225).

This was indeed a genuine bug relating to one of the libraries octave uses to convert openGL graphics to postscript, rather than the octave base itself, as per the octave bug submission (bug #49225).

从现已关闭的错误报告中:

From the now closed bug report:

此错误已在最新版本的gl2ps(1.3.9)中得到修复,但是linux mint 17.3随gl2ps 1.3.8一起提供.在Linux上,解决方法是编译自己的gl2ps版本."

"This bug has been fixed in the latest version of gl2ps (1.3.9), but linux mint 17.3 ships with gl2ps 1.3.8. On linux, the workaround is to compile your own version of gl2ps."

我可以确认安装了 libgl2ps1(1.3.9-4) libgl2ps-dev(1.3.9-4)并重新编译八度即可解决此错误.

I can confirm that installing libgl2ps1 (1.3.9-4) and libgl2ps-dev (1.3.9-4) and recompiling octave resolved this bug.

这篇关于保存到文件时,八度音阶未包含绘图的一部分的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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