图像绘图的对数 x 和 y 轴

Logarithmic x and y axis for image plot

我需要以不同的方式执行此操作,因为 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

是否有一个简单的解决该错误的方法。我使用 FLTK 后端。

更新

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

这是一个 "solution" 错误。这个想法是禁用图形的抗锯齿。

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');