I'm attempting to combine a surface plot with contours. Unfortunately, contours don't seem to play well. For instance, the lines all come out dashed and overlap the surface in a decidedly un-3D way.
I figured the best solution was to save contour data to a file and read it in. But I have no idea how to set gnuplot to plot this data at the base. If you have any suggestions, I'd appreciate them.
set border 15
#unset xtics
#unset ytics
unset ztics
unset colorbox
set cntrparam levels incremental -2, 1
set samples 200
set isosamples 200,200
range = 0.75*pi
set xrange [-range:range]
set yrange [-range:range]
a = 1
f(x,y) = 2*cos(sqrt(3)*y*a)+4*cos(sqrt(3)/2.0*y*a)*cos(3*x*a/2)
set table 'tmp.dat'
set nosurface
set contour base
set view map
splot '++' u 1:2:(f($1,$2)) notitle
unset table
unset contour
unset view
set surface
splot 'tmp.dat' u 1:2:(-6):(column(-2)) w l lw 2 lt -1 lc var notitle, \
'++' u 1:2:(f($1,$2)) w pm3d notitle
Ethan Merritt
2011-03-31
Please see demos at
http://gnuplot.sourceforge.net/demo/contours.html
"comes out dashed" sounds like maybe you set the terminal to used dashed lines rather than colors?
Douglas
2011-03-31
Actually, spending a little more time with it, I realize the problem was really specific:
You can set xyplane relative to the zrange, but then it's impossible to retrieve what it was set to.
Also, I'm trying to figure out how to set a white rectangle at the base, so that the contours pop up against another background...
Hans-Bernhard Broeker
2011-05-12
> You can set xyplane relative to the zrange, but then it's impossible to
> retrieve what it was set to.
And that gets in the way of ... what?
Hans-Bernhard Broeker
2011-07-31
Ethan Merritt
2013-04-28