Hi,
Am 12.06.2013 15:05, schrieb HorstSAut:
> Hello !
>
> In Gnuplot 4.6.0 I did not succeed write labels over the grid,
> even when I set label front, grid back:
>
> set grid xtics ytics
> set grid back
> set label 1 at -1,0 "This text should be in front"
> set label 1 front
the label is placed in front of the grid, but the label does not have a
background box, so between the letters you still see the grid. You can
see this, if you test your examples with a thicker line and a different
color, e.g.
reset
set xrange[-3:3]
set yrange[-3:3]
set xtics 1
set ytics 1
set grid xtics ytics
set grid back lw 10 lc rgb 'red'
set label 1 at -1,0 "This text should be in front"
set label 1 front
plot -1
So with version 4.6.0 you must place a rectangle object with white
fillcolor between grid and label:
reset
set xrange[-3:3]
set yrange[-3:3]
set xtics 1
set ytics 1
set grid xtics ytics
set grid back
set object rectangle from -1,-0.2 rto 1.8,0.4 fillcolor rgb 'white'\
fillstyle solid 1.0 noborder
set label 1 at -1,0 "This text should be in front"
set label 1 front
plot -1
To optimize this, you must adapt the size of the rectangle to your label.
In the development version of gnuplot there is an option 'boxed' for
labels, which allows this in an easy way:
reset
set xrange [-3:3]
set yrange[-3:3]
set xtics 1
set ytics 1
set grid xtics ytics
set grid back
set style textbox opaque noborder
set label 1 at -1,0 "This text should be in front" boxed
set label 1 front
plot -1
Christoph
|