X
PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 11 Oct 2007 02:47 PM by  anon
legend of shades range in idl plot
 1 Replies
Sort:
You are not authorized to post a reply.
Author Messages

anon



New Member


Posts:
New Member


--
11 Oct 2007 02:47 PM
    hello all I have beatiful plots of a hillslope with shades differing according to flow in the slope. With a procedure i create a variable which contains Information about the shade. The plot itself is a surface plot with the shade=myshade option. Now i would like to put a legend under the plot indicating which color ständs for low flux and which for high throughout the continuum i defined in my variable (like a rainbow bar) Thanks a lot for infos Marc

    Deleted User



    New Member


    Posts:
    New Member


    --
    11 Oct 2007 02:47 PM
    The kind of legend you are looking for is called a "colorbar". This kind of legend is a built-in part of IDL Object Graphics (it's called 'IDLgrColorbar'). It is also a built-in object available at the click of a button in any iTools (iPlot, iSurface, etc.) menu. However, there is no such built-in code for the same in IDL Direct Graphics. If you go onto Google and search for keywords "IDL" + "colorbar", you will probably find several third-party free source code downloads that will give you a widely configurable colorbar object for IDL Direct Graphics. They are probably based on either PLOTS or POLYFILL and have some kind of implementation similar to the following: ; Draws a vertical color ramp of the current color table with lower-left ; corner positioned at pixel coordinate [xOff, yOff] and ; pixel width of width ; Syntax: EX_DIRECT_GRAPHICS_COLORBAR, 16, 20, 10 PRO ex_direct_graphics_colorbar, barWidth, xOff, yOff device, DECOMPOSED=0 ; Enable indexed color loadct, 5 ; Load a colorful color table window, /FREE for i = 0, 255 do begin plots, [xOff, xOff + barWidth], [yOff + i, yOff + i], COLOR=i, /DEVICE endfor END James Jones
    You are not authorized to post a reply.