I'm trying to write a very simple wrapper for the contour command. I often make astronomical color-magnitude diagrams (CMDs). For historical reasons, these are plotted with inverted y-axes with the small values at the top. I have written a very basic script to handle tedium for me (eliminating invalid data, choosing the axes range, etc):
make_cmd,band1,band2,band3
I'd now like to add contours of sub populations on my existing CMD. Currently I do this by using hist_2d on my data, and then contour,myHist... However, the hist_2d command needs to know the range of the existing plot. How do I get the program to figure this out automatically. Right now I need to make the plot, look at it, and manually enter min1, max1... keywords into the hist_2d command. How do I get IDL to read the state of the axes it just created? The !X (or !Y) system variable doesn't contain the range, they're all 0's. But somehow oplot can figure them out, because I'm able to use that command on my existing plots.
Can someone tell me how oplot is figuring the axes out and how I can exploit that myself?
Cheers,
Dave
|