title: gnuplot contour line color: set style line and set linetype not working
body: <p>I am plotting data as described in a previous Stackoverflow question:
  <a href="https://stackoverflow.com/questions/18792461/gnuplot-2d-polar-plot-with-heatmap-from-3d-dataset-possible">gnuplot 2D polar plot with heatmap from 3D dataset - possible?</a>
  Mostly it is working well for me, and I am down to some small details. One of these is how to exert control over the contour line colors and linewidths. There are lots of posts on the web regarding using <code>set style increment user</code> followed by definition of user style via <code>set style line 1 lc rgb "blue" lw 2</code> etc. In theory this was supposed to force splot to plot lines using the newly defined styles. I tried it and it did not work. In addition, when I went to the help pages through my gnuplot install, I discovered that this usage is deprecated with my version (Version 4.7 patchlevel 0 last modified 2013-07-25). It was recommended to use set linetype instead, which changes the characteristics of the gnuplot line style permanently for the current invocation of gnuplot. Killing and restarting gnuplot restores the default linetype characteristics.</p>
  
  <p>Next, I restarted gnuplot, regenerated the plot without redefining any line style or type for the contour lines. When I looked at my plot, I could see that the line colors start with cyan, then purple, then blue (e.g. like line types 5,4,3 or 14,13,12, etc.). It seems as if the line types are going BACKWARDS through the available styles. OK, I thought, I can just change those and live with the odd behavior. However, after issuing multiple set linetype commands that changed all of these line types to something that would be obviously different (I verified these by running the <code>test</code> command, the contour lines on the plot still had the same color and line width as before. I can't seem to figure out what linetype is being used for the contour lines, so I can't change the appropriate linetype.</p>
  
  <p>Perhaps this odd behavior is a result of the contour line being of type <code>set cntrparam levels increment -6,-6,-24</code> and the negative values and/or negative going increment are causing some unpredictable behavior?</p>
  
  <p>I'd like to know how I can know what line type will be used for contour lines in this plot, and whether that will change if the number of lines used to build the surface plot change. For instance, the plot shown below uses 13 "lines" to generate the surface using <code>set pm3d map</code>. So let's say N=13 lines - is there a rule that is obeyed for the first contour linetype?. For instance, will I always be sure that the contour line style will start at N=14? I'd to know what line type will be used for the first and subsequent contour lines when the number of "lines" in my input data will vary.</p>
  
  <p>The bottom line is that I need to apply certain style to the contour lines used for each contour level. I want to consistently use the same style for each level when the input data changes. The plot will always use the same set of contour levels: -6, -12, -18, and -24. The plot data will always have a maximum "z" coordinate of about 0 and decrease from there.</p>
  
  <p>Gnuplot commands are shown below. The dataset for this plot can be downloaded here:
  <a href="http://audio.claub.net/temp/new_test.dat" rel="nofollow noreferrer">http://audio.claub.net/temp/new_test.dat</a></p>
  
  <pre><code>reset 
  set terminal pngcairo size 800,800 
  set output '3d-polar.png'
  
  set lmargin at screen 0.05
  set rmargin at screen 0.85
  set bmargin at screen 0.1
  set tmargin at screen 0.9
  
  set pm3d map interpolate 20,20
  unset key
  
  set multiplot
  
  # plot the heatmap
  
  set cntrparam bspline
  set cntrparam points 10
  set cntrparam levels increment -6,-6,-24
  set contour surface
  #set style increment user           #NOTE: the commented out lines do not seem to affect color or width of the the contour lines no matter what number I use for the linetype
  #set linetype 8 lc rgb "blue" lw 2
  #set linetype 9 lc rgb "black" lw 1
  #set linetype 10 lc rgb "orange" lw 1
  #set linetype 11 lc rgb "yellow" lw 1
  
  set palette rgb 33,13,10 #rainbow (blue-green-yellow-red)
  set cbrange [-18:0]
  
  unset border
  unset xtics
  unset ytics
  
  set angles degree
  r = 3.31 #This number is Log10(max frequency) - Log10(min frequency) of the polar frequency grid 
  set xrange[-r:r]
  set yrange[-r:r]
  set colorbox user origin 0.9,0.1 size 0.03,0.8
  splot 'new_test.dat'
  
  # now plot the polar grid only
  set style line 11 lc rgb 'black' lw 2 lt 0
  set grid polar ls 11
  set polar
  set logscale r 10
  set rrange[10:20000]
  unset raxis
  set rtics format '' scale 0
  #set rtics axis scale 
  set rtics (20,50,100,200,500,1000,2000,5000,10000,20000)
  do for [i=-150:180:30] {
  dum = r+0.15+0.05*int(abs(i/100))+0.05*int(abs(i/140))-0.05/abs(i+1)
  set label i/30+6 at first dum*cos(i), first dum*sin(i) center sprintf('%d', i)
  }
  set label 20 at first 0, first -(log(20)/log(10)-1) center "20"
  set label 100 at first 0, first -(log(100)/log(10)-1) center "100"
  set label 200 at first 0, first -(log(200)/log(10)-1) center "200"
  set label 1000 at first 0, first -(log(1000)/log(10)-1) center "1k"
  set label 2000 at first 0, first -(log(2000)/log(10)-1) center "2k"
  set label 10000 at first 0, first -(log(10000)/log(10)-1) center "10k"
  set label 20000 at first 0, first -(log(20000)/log(10)-1) center "20k"
  plot NaN w l
  unset multiplot
  unset output
  </code></pre>
  
  <p>The plot with no control over the contour lines is shown below. I need to be able to specify line color and width for the contour lines. How?</p>
  
  <p><img src="https://i.stack.imgur.com/tImle.png" alt="polar sonogram with default contour line styles"></p>