comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » USERSYM & LEGEND
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
USERSYM & LEGEND [message #77703] Fri, 16 September 2011 21:53
Nick[1] is currently offline  Nick[1]
Messages: 10
Registered: May 2007
Junior Member
Dear all,
I often use USERSYM to plot the symbol as a circle.
However, if I use 'legend.pro', something trouble happens.
That is, I couldn’t express symbols having exact color in the legend.
If you look at the result of following code, you can see the colors of
symbols in the legend are different from those in the line.
Who can solve this problem?
Please let me know.
Thank you in advance.

;+++++++++++++++++++++++++++++
pro test_legend
device, decomposed=0
window, 1
loadct, 39
A = FINDGEN(17) * (!PI*2/16.)
x = findgen(100)*0.1
y1 = sin(x) & y2 = cos(x)
USERSYM, COS(A), SIN(A), /FILL, color=254
plot, x, y1, psym=-8, background=255, color=0, /nodata, yrange=[-2,2],
xrange=[0,10]
oplot,x, y1, psym=-8, color=254
USERSYM, COS(A), SIN(A), /FILL, color=50
oplot,x, y2, psym=-8, color=50
items = ['sin(x)','cos(x)']
lines=[3,3]
legend, items, colors=[254,50], linestyle=lines, /normal, box=0,
psym=[-8,-8],textcolors=[254,50]
end
;+++++++++++++++++++++++++++++
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: IDL to write GrADS netCDF (SDF)
Next Topic: Re: Final Day IDL Book Sale

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Fri Oct 10 14:29:59 PDT 2025

Total time taken to generate the page: 0.56132 seconds