ContactDownloadsThesisForumCV

Main Menu
Home
Ph.D. Pursuit
Materials
EM Topics
F A Q
All Else

 Subscribe in a reader

Enter your email address:

Delivered by FeedBurner


Recommendations

Life as a Physicist

Ars Technica

Macenstein

strawberry hedgehog vegan bath products


Advertisements

July's Recommended Post: Diary of a Graduate Thesis Experiment

Contour Plotting Routine for IDL
Saturday, 28 January 2006

Update:

An object oriented version of this routine, one that uses iContour, is now available as conmakeOBJ.

Details

About

A routine for making contour plots in IDL is now available for download. IDL is a program used for the processing and visualization of data. If you do not use IDL, then this code will not be useful. If you use IDL but do not know a lot about it, then this code should be helpful because the source is significantly commented. If you have any questions or suggestions please feel free to contact me through any of the methods listed in FAQ - Sending Comments.

This routine works by generating a contour plot in the active graphics window. The best way to make images from the plot is to use the following command immediately after running conmake:

IDL> WRITE_PNG, 'desired_path/your_filename.png', TVRD( /TRUE )

where WRITE_PNG is a native IDL module and IDL> is the command prompt.

Examples

The minimum command line usage of this procedure is,

IDL> conmake, input, #

where input is a two dimensional array and # is the number of colors to use in the plot. Read the header of the source code for detailed notes on other parameter and keyword options.

The following images display some of the output that I have used from the conmake routine. These are the actual images produced with WRITE_PNG, and their file sizes are indicative of results you should expect for a similar setup.

contour plot
Fig. 1: Example contour illustrating axis labels and colorbar.

Fig. 1: This plot illustrates usage of the axis labels and colorbar. The command to produce this contour is,

IDL> conmake, input, xaxis, yaxis, 256, xlab=2, ylab=2, /cbar

where input (two dimensional array), xaxis (one dimensional array), and yaxis (one dimensional array) were IDL variables.

contour plot example 2
Fig. 2: Contour example illustrating use of the axis labels and minimum level settings without a colorbar. The vertical red line on the right side was not created with conmake.

Fig. 2: This image illustrates use of the axis labels and minimum level settings without a colorbar. The minlev keyword causes all data values below its value to be treated as missing data. The missing data, or noise level values in this case, are ignored. The white regions of the contour represent the absence of data. The command to produce this contour is,

IDL> conmake, input, xaxis, yaxis, 256, xlab=5, ylab=3, minlev=-18
contour plot example 3
Fig. 3: Contour example illustrating use of the axis labels, colorbar, and overplot settings. This image has been altered after initial creation in order to make it web friendly.

Fig. 3: This image shows the axis labels, colorbar, and overplot settings. The command to produce this contour is,

IDL> conmake, input, xaxis, yaxis, 256, xlab=2, ylab=2, overp=opinput

where opinput is a two dimensional array. The array to be overplotted should have the same scaling with the x and y axes as the main contour so that a sensible output results.

 

Changelog

The changelog of the file is provided so that you can more easily determine whether to download a new release.

  • 01/28/2006 - Commented for public release.
  • 01/29/2006 - Added /YSTYLE command to AXIS procedure of the colorbar. This ensures the colorbar exactly matches the levels (especially when using the minlev keyword).
  • 02/08/2006 - Corrected error in which levels were not rescaled according to selected x-range.
  • 03/14/2006 - Corrected error in which the X Begin value was displayed as the X End value when the "v" keyword was set.

Tags: , , ,

Last Updated ( Friday, 15 February 2008 )
 
< Prev   Next >

 

© 2000-2008 David Pace
Design by David Pace