X
PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 19 Jun 2015 11:47 AM by  anon
IDL plot function - upper limit symbol
 4 Replies
Sort:
You are not authorized to post a reply.
Author Messages

anon



New Member


Posts:
New Member


--
19 Jun 2015 11:47 AM
    I really like the format of the IDL plot function compared to the procedure version, however I'm having a difficult time figuring out how to plot a downward arrow indicating an upper limit to a value. With the plot procedure, I could use PSYM=8 after defining the symbol using PLOTSYM, 1 which gave me a downward arrow. The symbols for the plot function do not have a downward arrow available. Is there a way to do this or do I need to go back to using the procedure instead?

    Zachary Norman



    Basic Member


    Posts:173
    Basic Member


    --
    19 Jun 2015 12:21 PM
    Hi Laura, It looks like PLOTSYM is from the AstroLib library which is a third party library. I have never used this library function before, so would it be possible to include a small example of what you are hoping to achieve? Apart from that the following example illustrates the use of a text annotation and the '$\Downarrow$' to create an arrow that points down. Alternatively you can also use '$\Upwnarrow$' for an upwards pointing arrow. This example comes from http://www.exelisvis.com/...xt_annotations.html. Hope this helps! ; Define the data. temp09 = [28,36,42,47,55,62,63,75,66,47,44,32] months = [1,2,3,4,5,6,7,8,9,10,11,12] ; Draw the first plot. p = PLOT(months, temp09, 'r', $ YTITLE='Temperature in $\circ$ Fahrenheit', $ XTITLE='Months', $ TITLE='Average Monthly Temperature', $ THICK=2) ; Add annotations to describe the data. arrow = TEXT(0.58, 0.64, '$\Downarrow$', /CURRENT) difftext = TEXT(0.5, 0.62, $ 'Greatest $\circ$ F $\Delta$', /CURRENT)

    Deleted User



    New Member


    Posts:
    New Member


    --
    19 Jun 2015 03:01 PM
    I guess my question could be restated as is there a way to plot user defined symbols in the plot function? Instead of a circle, 'o', square, triangle or any of the defined symbols I would like to use a user-defined symbol for plotting like PSYM does for the plot procedure. Is this possible in the plot function? ?? The way that PLOTSYM defines a down arrow is by the following: xarr = [0,0,.5,0,-.5]*psize yarr = [0,-2,-1.4,-2,-1.4]*psize fill = 0 Where psize is just a factor by which the symbol is multiplied/enlarged. I would like to use this user-defined symbol in my plotting which instead of putting a circle at a specific x and y on my plot, I would put this symbol where the base of the arrow begins at the data point.

    Deleted User



    New Member


    Posts:
    New Member


    --
    19 Jun 2015 03:34 PM
    I'm getting close to what I would like to plot and here is what I have: x=[3,1,8,3,5,10] y=[4,8,10,2,5,6] newplot=plot(x,y,symbol='_',sym_color='blue',linestyle=6,xrange=[0,11],yrange=[0,11],sym_thick=2) uppersym=symbol(x,y,sym_text='$\downarrow$', sym_color='blue', /data,sym_thick=2,sym_font_style=1,sym_size=1.5) However, I would like the base of the arrow to be at the horizontal line so that the line is point away from that data point. Any suggestions?

    Zachary Norman



    Basic Member


    Posts:173
    Basic Member


    --
    22 Jun 2015 09:31 AM
    Laura, I would suggest including something like an offset for the y-values in the symbol call. Here is an example. Hope that answers your question! x=[3,1,8,3,5,10] y=[4,8,10,2,5,6] offset=.275 newplot=plot(x,y,symbol='_',sym_color='blue',$ linestyle=6,xrange=x_range,yrange=y_range,sym_thick=2) uppersym=symbol(x,y-offset,sym_text='$\downarrow$', sym_color='blue', $ /data,sym_thick=2,sym_font_style=1,sym_size=1.5)
    You are not authorized to post a reply.