O'Reilly logo

gnuplot Cookbook by Lee Phillips

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Combining contours and images

Sometimes we would like to plot two related but different sets of data on the same graph. In the case of 2D plots, it's simple: we just plot any number of curves and identify them with labels or a legend. But with 3D plots, trying to interpret a graph containing two different surfaces or sets of contours would be difficult, and plotting two heat maps simultaneously would not make any sense.

Combining contours and images

The previous figure shows one way to do this: plot contours and an image map together.

How to do it…

Feed this code to gnuplot to get the previous figure:

set xrange [0:pi] set yrange [0:pi] set iso 100 set samp 100 set cntrparam levels ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required