|
From: Ethan M. <merritt@u.washington.edu> - 2010-05-30 19:32:43
|
On Thursday 27 May 2010, Tom Rosmond wrote: > Gnuplot users: > > Maybe I am just slow, but I have been unable to find an easy way to make > color filled contour plots with Gnuplot. Attached are 3 PDF files: > > 1. contour.pdf: a contour line plot from another graphics program > 2. shaded.pdf: a color filled version of #1 from the same program > 3. gnuplot.pdf: a contour line plot from gnuplot that I would like to > color fill as in #2. > > Here is the input file to Gnuplot used to produce #3: > > set output "contour.ps" > set term postscript color > set title "CONTOURS" font "Helvetica,25" > set ylabel "LOG P" font "Helvetica,20" > set xlabel "LOG P" font "Helvetica,20" > set xrange[1:11] > set yrange[1:11] > set size square > unset surface > set view map > set contour > set data style lines > set logscale xy > set contour base > set cntr levels 10 > splot 'ijx.dat' > pause -1 > > None of the Gnuplot 'demo' examples really produce an equivalent to #2, > in my opinion. I have tried various options to 'pm3d' and 'palette', > but nothing seems to work very well. I have seen many online queries > about the same problem, and all proposed solutions seem overly > complicated for what should be a fairly simple problem. Easy for me to > say, of course. Although filling in colors between contour lines may seem simple, it's not. Sure, you can find examples where the fill color is "obvious". But the general case is much harder. Anyhow, the closest equivalent in gnuplot would be something like: set pm3d set palette maxcolors 10 set view map splot 'ijx.dat' with pm3d Note that these commands do not actually draw contour lines. Instead they say "color by quantized values of z". You may have to set explicit bounds on the color range to get the color jumps at the values you want: set cbrange [level0 : level10] > > Anyway, if anyone has any suggestions or examples, I will appreciate it. > > T. Rosmond > > |