Is there any way to have gnuplot color the tic marks in the x and/or y axis? I'm using a background png file which is quite dark and I'd like the inner tics to show in white over it, not the default black.
2 Answers
The tics seem to inherit their color from the border:
set style line 50 lt 1 lc rgb "red" lw 2
set border ls 50
plot sin(x)
The tic labels get their color from the textcolor option of tics:
set tics textcolor rgb "red"
(The string "white" should work too, but that wouldn't look very nice in my demonstration since my background is white).
There is no way to change just the tic-color. However, if you want, you can change the tic/border color and then add a new border on top:
set arrow from graph 0,graph 1 to graph 1,graph 1 nohead ls -1 lc rgb "black" front
set arrow from graph 1,graph 1 to graph 1,graph 0 nohead ls -1 lc rgb "black" front
set arrow from graph 1,graph 0 to graph 0,graph 0 nohead ls -1 lc rgb "black" front
set arrow from graph 0,graph 0 to graph 0,graph 1 nohead ls -1 lc rgb "black" front
11 Comments
#RRGGBB is probably slightly more system independent. Red = #ff0000, white = #ffffff ... (although red and white should be recognized almost everywhere)set style line 50 ... creates a new linestyle. It uses linetype (lt) 1 which is typically solid, line color (lc) red and linewidth (lw) 2 (which means 2x the normal width). That linestyle is tagged by gnuplot as line-style 50. So, when I use the second line (set border ls 50), it says to plot the border using linestyle 50 (which is the one I just defined).y1 and y2. Mission impossible?Whilst this post is quite old, I though I'd offer my 2cents because I have a valid addition to the above.
If you immediately follow the set border command with unset border, then the colour of the tics & their labels remains in the colour you set, and the border just gets removed. For example,
set border linecolor rgb "gray75"
unset border
This way, you can at least change the colour of the tics & their labels (here, off-white), & your background remains dark & untainted by an unsightly (off-white) border, which is what the OP asked for?
Thus, no need to manually redraw the border in the previous answer. Still, the best answer above was useful to me so I will uptick!