我正在使用gnuplot生成一些x轴为0到20的图.是否可以将某些抽搐或轴编号的颜色设置为与标准黑色不同的颜色?
我只找到了一种方法,用set xtics textcolor rgb“red”改变x轴红色中所有数字的颜色.
我需要的是能够将x = 0,3,6,…更改为抽搐或数字的颜色为红色,其他所有颜色应保持黑色.这可能与gnuplot有关吗?
最佳答案 tic标记的颜色由边框颜色设置,因此可以执行以下操作:
reset
set multiplot
set xrange [-5:5]
set xtics -5,1,0 # these tic marks will show up in black (the default border color)
set yrange [] writeback # save auto-generated y range for later
plot sin(x)
set border 0 linecolor "red" # change border color, and turn off drawing of the border
set xtics 1,1,5 textcolor "blue" # these tic marks will show up in the new border color, and we can specify the color of the labels
unset ytics # we don't want to display the y tics again
set yrange restore # use same range for y axis as before
unset key
plot NaN
unset multiplot
此解决方案还使用多重绘图,但仅使用第二个绘图来绘制颜色与默认黑色不同的抽动标记和标签.重要的是两个图具有相同的范围和边距.