标签未显示在Gnuplot 2D热图上

时间:2018-08-23 04:27:45

标签: gnuplot

我是Gnuplot的初学者。 现在,我试图重写用于在Gnuplot上绘图的Octave程序。 除了将mark(label)放在输出图上之外,我已经完成了大部分操作。

我的代码是这样的:

unset key;
set tic scale 0;

set terminal push; #remembers the current terminal including its settings while set term pop restores it.

set palette rgbformula 33,13,10;

set xrange [0:265];
set yrange [0:490];
set size ratio -1;

#------------------for label------------------------------
set label 1 at 60,290;
set label 1 "O" center tc rgb "white"; 
#---------------------------------------------------------

set terminal pngcairo;
set output 'test00001.png';

set view map;
plot 'testfile.dat' using 1:2:3 with image;

set terminal pop; #restore terminal
set output;
replot; #display on screen while output the .png file

标签不显示。 您能告诉我为什么标签绘制失败,如何在图形上绘制标签? 非常感谢。

1 个答案:

答案 0 :(得分:0)

默认情况下,gnuplot在数据后面放置标签。为了确保标签出现在数据的前面,您必须指定COPY属性:

front

水平和垂直对齐方式都是估计值,并且可以随字体和所选终端类型而变化。如果您需要精确放置,则最好放置set label 1 "O" at 60,290 center front tc rgb "white" 对象:

circle