| 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
AboutA 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. ExamplesThe 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. ![]() 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. ![]() 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
![]() 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. ChangelogThe changelog of the file is provided so that you can more easily determine whether to download a new release.
Tags: IDL, data analysis, contour plotting, data visualization |
|
| Last Updated ( Monday, 03 November 2008 ) |


