Department of Physics
3 West 3.2
University of Bath
Claverton Down
Bath
BA2 7AY
01225 386437


Home
Top
pm3d

gnuplot Documentation+

When you have some 3 dimensional data set, it is sometimes tempting to visualise it quickly in gnuplot using set pm3d map. This is all well and good, but it's important to know this algorithm's assumptions. No-one wants to publish a paper without knowing all his assumptions.

Here is an example of how different a single data set can look with different triggers for set pm3d map and how important it is to know exactly what's going on.

1 pm3d

The gnuplot documentation is not very clear about some of the options for pm3d:

set pm3d corners2color {mean|geomean|median|min|maxc1|c2|c3|c4}

What's particularly confusing is the difference between mean, geomean, median and indeed min and max. The options for c1,c2,c3,c4 are relatively well documented in the examples from the official homepage. Thankfully, the source code is well commented! From pm3d.c, we can get clearer explanations as to what's going on.

1.1 mean

This isn't a function, but just a straight forward sum of the four adjacent gridded data point values, divided by 4. It doesn't check for incomplete grids. If set pm3d is used with no other options, then mean is the algorithm used.

1.2 geomean

The function geomean4 is short for geometrical mean, g. It's defined as

where the index i signifies the four adjacent gridded data points that pm3d uses for its surface. The geometrical mean stops extreme events dominating the weighting of the splot surface. g is positive is 3 or more corners are positive. It is negative is 3 or more corners are negative.

1.3 median

The median4 function sorts the (four) adjacent gridded data point values and then finds the median for use as the pm3d surface at that particular point. If the grid is not complete, this algorithm can still cope. For the number of data points being odd, the median value is just the middle value. For the number of data points being even, obviously the median value is the mean of the two middle values.

1.4 minimum

The function minimum4 computes the minimum of the four adjacent gridded data point values for use as the pm3d surface

1.5 maximum

The function maximum4 computes the maximum of the four adjacent gridded data point values for use as the pm3d surface

Comments

As the example shows, very different visualisation of data is seen depending on the options set for pm3d map. When your data varies quite smoothly, then c1,2,3,4 option shows the data the most faithfully. I guess the upshot of this section is: play around with the pm3d options.


Prototyped with Markdown and inline HTML