Contour Plots
1: Introduction 2: Simple example 3: Fancy example 4: Running Gri 5: Programming Gri 6: General Issues 7: X-Y Plots 8: Contour Plots 9: Image Plots 10: Examples 11: Handling Data 12: Gri Commands 13: Gri Extras 14: Evolution of Gri 15: Installing Gri 16: Gri Bugs 17: System Tools 18: Acknowledgments 19: License 20: Newsgroup 21: Concept Index |
8: Contour PlotsContour plots can be done with either pregridded data or randomly distributed (ie, ungridded) data.
8.1: Pre-gridded DataThis section presents two examples of contouring pre-gridded data, the first example illustrating a boilerplate program to quickly contour data stored in a simple matrix form in a file, the second example illustrating a case with more control of the details (e.g., nonuniform grid).8.1.1: Simple exampleThis example was hardwired to know the size of the grid, etc. Here's an example which is more general, in that it determines the dimensions of the grid data from using unix system commands. Note that the grid is set to run from 0 to 1 in both x and y; you'll most likely want to change that after you see the initial plot, but this should get you started.
\.awk. ', a builtin synonym naming the awk program
on your system.)
8.1.2: Complicated exampleTo get a simple contour graph based on pre-gridded data, with full control of axes, etc, do something like this:![]()
Here several new things have been introduced.
First, you've got to define a grid in xy space. This example uses a
non-uniform x-grid, and reads it in from the commandfile. In this form,
the blank line is essential; it tells Gri that the end of data has been
located; if you like, you can specify the number of lines to read, as in
` 8.2: Ungridded dataWhen you have f=f(x,y) points at random x and y, you must cast them onto a grid to contour them. This is a difficult problem. There are many ways to grid data, and all have both good and bad features. You should try various methods, and various settings of the parameters of the methods. If you have a favorite gridding method that you prefer, you should probably pre-grid the data yourself. If not, Gri can do it for you. Gri has two methods for doing this, the ``boxcar'' method and the ``objective analysis'' method. Each method puts holes in the grid wherever there are too few data to map to grid points, unless you specifically ask to fill in the whole grid. The next two sections show first an example, then a discussion of the methods and how to use them.8.2.1: ExampleThis example uses data taken from Figure 5 of S. E. Koch and M. DesJardins and P. J. Kocin, 1983. ``An interactive Barnes objective map anlaysis scheme for use with satellite and conventional data,'', J. Climate Appl. Met., vol 22, p. 1487-1503. Readers should compare Figures 5 and 6 of that paper to the results shown here.![]()
8.2.2: Discussion of MethodsThe various commands for converting columns to a grid are given in see Convert Columns to Grid. Generally, the Barnes method is best. |