X
PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 02 Oct 2015 11:24 AM by  Zachary Norman
Help generating a plot
 3 Replies
Sort:
You are not authorized to post a reply.
Author Messages

Zachary Norman



Basic Member


Posts:173
Basic Member


--
02 Oct 2015 11:24 AM
    Hi, I would like to get your suggestion on how to generate a figure with a map and, at various locations of the map, I need to put a specific plot (not at all the same). I know the location where each plot should go but they don't have the same axis size as the map so I don't see how I can do it.

    Zachary Norman



    Basic Member


    Posts:173
    Basic Member


    --
    02 Oct 2015 11:25 AM
    Hello, You can do this pretty easily with the POSITION keyword for function graphics and direct graphics. For direct graphics you also need to specify the NOERASE keyword to keep the first graphic there. Here is a small example of how to do that for both: plot, findgen(10) plot, findgen(10), position = [.3,.1,.4,.2], /noerase p = plot(findgen(10)) p2 = plot(findgen(10), /current, position = [.5,.3,.6,.4])

    Deleted User



    New Member


    Posts:
    New Member


    --
    05 Oct 2015 09:10 AM
    Hi, Thanks for the suggestion. However, my main problem is that the base figure is a map. Then the map and the "insert" figures are not with the same scale. The idea is to be able to change the map to any x- and y-range and put the insert figures to their respective location. I am trying to include a figure with this request to explain what I want but the attachment window does not allow me to insert anything. Thanks, A.

    Zachary Norman



    Basic Member


    Posts:173
    Basic Member


    --
    05 Oct 2015 03:57 PM
    Hi Andry, One method for new function graphics is to use the ConvertCoord method which can be used to convert from your data coordinates to device coordinates (pixel x and y). From here, you will have an x-y pair for one of the corners of your custom graphic in the overall graphics window. This is useful because you can set the DEVICE keyword in your next call to PLOT and the value for the POSITION keyword will be given in pixels which you will have already. The only thing you might need to play with is the pixel size of each plot. If that doesn't make sense I can come up with a small example for you. I hope that helps!
    You are not authorized to post a reply.