Remove item from gnuplot legend

I need to build three implicit functions with 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 result is as follows: enter image description here

The program writes 0 surface levels in the legend, but I just need the title parameter passed to the splot command. Since the three surfaces are actually the same at different heights, I could change the set cntrparam... line to draw three of them, but what I want to do is delete the numbers and make the text write. How can i do this?

+5
source share
1 answer

You cannot directly manipulate outline level labels with any text. Just write the outlined data to a temporary file using set table... and then write this data file as usual. Here you can distinguish different levels of paths 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' 

Result image

+2
source

All Articles