3
votes

another question about contour plot. I am using

    G N U P L O T
    Version 4.6 patchlevel 6    last modified September 2014
    Build System: Linux x86_64

and i am trying to plot a coloured map and over it a contour map. My terminal is

    set terminal pngcairo enhanced size 1440,900 crop font "Palatino,27"

and i want to plot this

    set contour surface
    set cntrparam level discrete 0.3,0.067
    set style line 2 lt 1 lc rgb "black" lw 3
    set style line 3 lt 3 lc rgb "black" lw 1
    set style increment user
    splot 'file1' binary w pm3d nocontour,\
          'file2'  binary w l  nosurface

so the contour is set up to plot two isolines, both black, one dashed, one solid, one thick, one thin. It plots two solid red lines with equal thickness.

I tried many solutions found here and there on Google.

1) i replace the "set style line ..." with "set linetype ..." and delete the "set style increment user" line. Lines become both black, solid, equal thickness. I can change the color.

2) i tried to add the "set termoption dashed" line. Nothing, dashed never seen.

Where am I wrong?

Many thanks.

1
You have to use "set linetype", "set termopt dashed", and use linetypes with the desired dashing as templates. - Karl
@KarlRatzsch But that doesn't work properly for plotting contours. - Christoph
@KarlRatzsch, this is exactly what i tried and told in bullet 2). It does not work. - marco
Without the "dashed" termoption, gp46 only has one very finely dashed linetype, that's type "0". gp50 has a new "dashtype" option instead. But yes, the dashing doesn't work properly on contours. That's a bug. On the base plane below the 3D plot, you cannot get proper dashed lines, on the surface the procedure outlined below by Christoph works fine. - Karl

1 Answers

1
votes

Indeed, currently you cannot use arbitrary line types or styles for different contours. Changing the color works, also setting one dash type (the one of the first contours style is used then), but not mixing dashed and solid and changing the linewidth.

In that case you must write the contours to a file, as you did in your first question :)

The different contour levels can later be accessed with the index keyword. But note, that in the first data set you'll have the complete surface, the contours start at index 1:

set termoption dashed
set contour surface
set cntrparam level discrete 0.3,0.067
set style line 2 lt 1 lc rgb "black" lw 3
set style line 3 lt 3 lc rgb "black" lw 1

set table 'temp.dat'
splot 'file2' binary 
unset table
unset contour

splot 'file1' binary w pm3d nocontour,\
      for [i=1:2] 'temp.dat' index i with lines ls (i+1)