对数x和y轴用于图像绘图

时间:2015-09-05 17:04:13

标签: plot octave

我需要以不同的方式执行此操作,因为pcolor会在输出文件中生成对角线

h=pcolor(rand(16)); %The actual data comes from hist3
set(h,'EdgeColor','none');
colormap(gray(256));
set(gca,'yscale','log');
set(gca,'xscale','log');
print('test.png','-dpng','-r4800'); %Gives diagonal lines in text.png

这个bug有一个简单的解决方法吗?我使用FLTK后端。

更新

切换到gnuplot会删除对角线,但会添加垂直和水平线,但更改会使绘图边距增加太多。

1 个答案:

答案 0 :(得分:0)

这是bug的“解决方案”。我们的想法是禁用图形的抗锯齿功能。

gswrapper.sh

#!/bin/bash

ARGS=()
ARGS+=("-dGraphicsAlphaBits=1")
for var in "$@"; do
    [ "$var" != '-dGraphicsAlphaBits=4' ] && ARGS+=("$var")
done
gs "${ARGS[@]}"

八度脚本:

h=pcolor(rand(16)); %The actual data comes from hist3
set(h,'EdgeColor','none');
colormap(gray(256));
set(gca,'yscale','log');
set(gca,'xscale','log');
print('test.png','-dpng','-r600','-G./gswrapper.sh');