Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

pm3d map with contour lines?

2,996 views
Skip to first unread message

Leslaw Bieniasz

unread,
Oct 28, 2010, 6:23:24 AM10/28/10
to

28.10.2010

Hi,

I need to plot a pm3d colour map, for the two variable function z=z(x,y)
available in the form of discrete z values on a regular x-y grid. The
values are in a file. Plotting the map appears relatively easy, but it
would be nice to have simultaneously contour lines on the plot, together
with labels on every line, indicating the actual value of z for the lines.
I have seen some solution to this problem somewhere on the internet, but
it was very complicated and unclear, requiring writing additional scripts
and creating temporary files. Is there no easier way to do this, just by
choosing standard Gnuplot commands? I want to have black contour lines
with black labels, overlaid on the coloured pm3d map, and I also want
to have a vertical colour box of the same height as the plot.

Leslaw

sfeam

unread,
Oct 29, 2010, 2:41:20 AM10/29/10
to
Leslaw Bieniasz wrote:

> I need to plot a pm3d colour map, for the two variable function
> z=z(x,y) available in the form of discrete z values on a regular x-y
> grid. The values are in a file. Plotting the map appears relatively
> easy, but it would be nice to have simultaneously contour lines on the
> plot,

So far it sounds easy enough.

> together with labels on every line, indicating the actual value
> of z for the lines.

But none of us have been clever enough to figure out how to
automate that part.

> Is there no easier way to do this, just by choosing standard Gnuplot
> commands? I want to have black contour lines with black labels,
> overlaid on the coloured pm3d map, and I also want to have a vertical
> colour box of the same height as the plot.
> Leslaw

Here you go:

set view map
set contour base
set cntrparam cubicspline
set cntrparam levels auto 10
unset clabel
unset key
set style data lines
set xlabel "X axis"
set xrange [ 0.00 : 15.0 ]
set ylabel "Y axis"
set yrange [ 0.00 : 15.0 ]
set zlabel "Z axis"
set zrange [ -1.20 : 1.20 ]

splot 'glass.dat' using 1 with pm3d nocontour, \
'' using 1 with lines lc rgb "black" nosurface


0 new messages