X
PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 29 Nov 2011 01:58 PM by  anon
Determining plotting range
 2 Replies
Sort:
You are not authorized to post a reply.
Author Messages

anon



New Member


Posts:
New Member


--
29 Nov 2011 01:58 PM
    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

    Deleted User



    New Member


    Posts:
    New Member


    --
    29 Nov 2011 03:04 PM
    Hi Dave, Have you looked into the !Y system variable within IDL ? vincent sorry, should read all the message before answer ;-)

    Deleted User



    New Member


    Posts:
    New Member


    --
    30 Nov 2011 08:34 AM
    If Make_Cmd is creating some kind of plot on the display using some kind of normal plotting command (e.g., Plot, Contour, etc.), then it is exceedingly unlikely (nay, impossible!) that the !X and !Y system variables don't know about it. :-) The "calculated" or final range of the axes are stored in !X.CRange and !Y.CRange fields. The position of the axes are stored in !X.Window and !Y.Window. OPlot uses this information, as well as the scaling factors in !X.S and !Y.S to locate itself on the graphics display.
    You are not authorized to post a reply.