X
PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 22 Jan 2013 07:41 AM by  anon
contour plots
 2 Replies
Sort:
You are not authorized to post a reply.
Author Messages

anon



New Member


Posts:
New Member


--
22 Jan 2013 07:41 AM
    How do I set the colors for a contour plot if I want 10 colors ranging from blue to red?

    Deleted User



    New Member


    Posts:
    New Member


    --
    22 Jan 2013 08:36 AM
    data = cgDemoData(2) ncolors = 10 levels = Indgen(10)* 175 cgLoadCT, 22, /Brewer, /Reverse, NColors=ncolors, Bottom=1 cgContour, cgDemoData(2), C_Colors=BIndgen(ncolors)+1, /Fill, Level=levels, /Outline, Position=[0.1, 0.1, 0.9, 0.8] cgColorBar, NColors=ncolors, Bottom=1, Range=[0,ncolors*175], /Discrete You can learn more about this here: http://www.idlcoyote.com/...s_tips/cgcontour.php You can download a picture of the output here: http://www.idlcoyote.com/misc/contour_example.png

    Deleted User



    New Member


    Posts:
    New Member


    --
    23 Jan 2013 08:50 AM
    You should check out our CONTOUR() and COLORBAR() functions: http://www.exelisvis.com/docs/COLORBAR.html http://www.exelisvis.com/docs/CONTOUR.html For example, try this: file = FILEPATH('convec.dat', $ SUBDIR=['examples', 'data']) z = READ_BINARY(file,DATA_DIMS=[248,248]) index = [30,60,90,120,150,220,255] c = CONTOUR(z, /FILL, ASPECT_RATIO=1, $ RGB_TABLE=39, RGB_INDICES=index, C_VALUE=index) cb = colorbar() You can create a discrete colorbar, or a continuous one, or one with tapered edges if you like. You'll need the latest version of IDL to take advantage of the discrete colorbar. -Josh Exelis VIS
    You are not authorized to post a reply.