Gnuplot grid with alternative line styles

Using Gnuplot I’ll build the following graph -

Now, as you can see in the image, between the lines it is difficult to identify the block at the end. Therefore, I would like to color the grid alternately with a different color or style.

The code right now I'm using to color the grid -

set style line 12 lc rgb '#808080' lt 0 lw 1
set grid back ls 12

However, I cannot find a way to get the grid and set it alternately in a different style. Is this possible in Gnuplot?

I mean, is it possible to have a different line style for primary and secondary ticks in the gnuplot grid?

Thanks!

enter image description here

+4
source share
1 answer

Yes, you can use different styles for the small and main grid lines, see help grid:

set style line 12 lc rgb 'blue' lt 1 lw 2
set style line 13 lc rgb 'red' lt 1 lw 1
set grid xtics ytics mytics mytics ls 12, ls 13
set mxtics 4
set mytics 4
plot x

Result from 4.6.3:

enter image description here

+5
source

Source: https://habr.com/ru/post/1525084/


All Articles