I have to plot three implicit functions using gnuplot, I use this:
set contour
set cntrparam levels discrete 0
set view map
unset surface
set isosamples 1000,1000
set xrange [-5:7]
set yrange [-15:15]
set xlabel "x"
set ylabel "y"
splot y**2-x**3+15*x-13 t "t1", y**2-x**3+15*x-sqrt(4.*15.**3/27.) t "singular", y**2-x**3+15*x-30 t "t2", y**2-x**3+15*x-13 t "t3"
And the output is this:
The program is writing the 0 of the level of the surface in the legend but I just want the title
parameter passed to the splot command. As the three surfaces are actually the same at a different height, I could change set cntrparam...
line to draw the three of them, but what I want to do is to remove the numbers and make it write just text. How can I do that?
You cannot directly manipulate the contour level labels with any text. Just write out the contoured data to a temporary file using set table...
and then plot this data file as usual. Here, you can now distinguish between different contour levels using index
:
set contour
set cntrparam levels discrete 0
set view map
unset surface
set isosamples 1000,1000
set xrange \[-5:7\]
set yrange \[-15:15\]
set xlabel "x"
set ylabel "y"
set table 'contour.dat'
splot y**2-x**3+15*x-13 t "t1", y**2-x**3+15*x-sqrt(4.*15.**3/27.) t "singular", y**2-x**3+15*x-30 t "t2", y**2-x**3+15*x-13 t "t3"
unset table
set style data lines
plot 'contour.dat' index 0 title 't1', '' index 1 title 'singular', '' index 2 title 't2', '' index 3 title 't3'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With