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
;+++++++++++++++++++++++++++++
|