X
PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 14 May 2015 03:38 PM by  anon
Issues with Legend function
 1 Replies
Sort:
You are not authorized to post a reply.
Author Messages

anon



New Member


Posts:
New Member


--
14 May 2015 03:38 PM
    I'm adding a legend to a plot using the legend function. The legend shows the correct name and symbol for each data set, but the symbol appears three times in front of the text instead of just once. Does anyone know how to get a single symbol in front of the text in the legend? I'm calling the function as follows: MIPS= PLOT(MIPS.Sersic_Index, MIPS.BT_ratio, XRANGE=[0,8.0], YRANGE=[0,1.0], $ YTITLE='B/T', XTITLE='n', /CURRENT, $ AXIS_STYLE=1, COLOR='blue', thick=2, linestyle=6, symbol='D', sym_filled=1) control= PLOT(control.Sersic_Index, control.BT_ratio, /overplot, color='black', linestyle=6,thick=2,symbol='tu', sym_filled=1) leg = LEGEND(TARGET=[MIPS,control], position=[0.4,0.9], /normal, $ text_color='black', linestyle=6, shadow=0, font_size=10) Any suggestions would be much appreciated!

    Deleted User



    New Member


    Posts:81
    New Member


    --
    14 May 2015 06:38 PM
    Hi, try this: x = RANDOMU(seed, 100) y = RANDOMU(seed, 100) * 2 - 1 p0 = SCATTERPLOT(x, y, $ SYM_COLOR='red', SYMBOL='o', $ SYM_SIZE=1, SYM_THICK=2, $ NAME='Random points', $ CLIP=0) x = FINDGEN(50)/49.0 p1 = PLOT(x, SIN(x * 360 * !DTOR), $ SYM_COLOR='blue', SYMBOL='star', $ SYM_SIZE=2, SYM_THICK=2, $ LINESTYLE=6, $ NAME='Other points', $ CLIP=0, $ CURRENT=p0, /OVERPLOT) ; Create Legend with only one symbol displayed lgnd = LEGEND(TARGET=[p0, p1], $ SAMPLE_WIDTH=0, $ ; make symbols overlap HORIZONTAL_SPACING=.1, $ ; position nicely /AUTO_TEXT_COLOR)
    You are not authorized to post a reply.