tio*_*iom 5 axis gnuplot colors
我正在使用 gnuplot 生成一些 x 轴范围从 0 到 20 的绘图。是否可以将某些抽动或轴编号的颜色设置为与标准黑色不同的颜色?
我只找到了一种方法来将 x 轴中所有数字的颜色更改为红色set xtics textcolor rgb "red"。
我需要的是能够将抽动或数字的颜色更改为x=0,3,6,...红色,而所有其他颜色应保持黑色。这可以用 gnuplot 实现吗?
刻度线的颜色由边框颜色设置,因此可以执行以下操作:
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
Run Code Online (Sandbox Code Playgroud)
此解决方案也使用多重图,但仅使用第二个图来绘制颜色与默认黑色不同的刻度线和标签。重要的是,这两个图具有相同的范围和边距。
| 归档时间: |
|
| 查看次数: |
5192 次 |
| 最近记录: |