Department of Physics
3 West 3.2
University of Bath
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.
The gnuplot documentation is not very clear about some of the options for pm3d:
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.
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.
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.
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.
The function minimum4 computes the minimum of the four adjacent gridded data point values for use as the pm3d surface
The function maximum4 computes the maximum of the four adjacent gridded data point values for use as the pm3d surface
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