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

Home » Public Forums » archive » cgcontour colours for 2 panel plot
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: cgcontour colours for 2 panel plot [message #84831 is a reply to message #84828] Wed, 12 June 2013 09:25 Go to previous messageGo to previous message
Phillip Bitzer is currently offline  Phillip Bitzer
Messages: 223
Registered: June 2006
Senior Member
If I may, let me throw a different way of handling this in here, that doesn't bother with color tables.

Let's say you have 5 levels you want. Here's some pseudo-code below. You shouldn't have to worry about where in the color table one range falls relative to the other in this case.

I've also put a snippet of some IDL notes I have up that may or may not help here:
https://docs.google.com/file/d/0BxRn65i6z-Z5bjhFUUM1RWNVb0k/ edit?usp=sharing

;define some colors
colors = ['blue', 'red', 'green', 'yellow', 'orange']

nLev = N_ELEMENTS(colors)

;and get the palette for these colors:
rgb = cgCOLOR(colors, /TRIPLE)

;define some levels:
levs = FINDGEN(nLev)*10

;and make the plots:
cgContour, data1, LEVELS = levs, PALETTE=rgb
cgContour, data2, LEVELS = levs, PALETTE=rgb

;now define the tickmarks for the colorbar:
l_ticks = [STRING(levs, FORMAT='(F4.1)'), ' ']

;now make the color bar
cgCOLORBAR, NCOLORS=nLev, PALETTE=rgb, DIVISION=nLev, TICKNAMES=l_ticks
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Polyfill overlap issue
Next Topic: dialog_pickfile - multiple directories

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

Current Time: Sat Oct 11 02:14:38 PDT 2025

Total time taken to generate the page: 1.35252 seconds