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

Home » Public Forums » archive » Color problem with contours
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
Color problem with contours [message #67219] Wed, 08 July 2009 01:49
robintw is currently offline  robintw
Messages: 37
Registered: March 2009
Member
Hi,

I'm trying to plot a circular (polar) contour plot using the map
plotting commands. I've attached my code below. I don't really
understand much about colours in IDL, but I found that it was being
displayed as white text on a black background. After a bit of playing
I found that adding the lines under the comment "Load colors into
colortable" made it display with a white background and black text.

However, this seems to add an extra line at the bottom of the
colortable, which means that very low values of my contours plot as
white (which makes it look as if they're not there, as the background
is white).

As I said, I don't really quite get IDL colors, even though I've read
various bits in books about them. I've tried playing with the "bottom"
keywords to various routines, but that doesn't really seem to help.
I've also tried playing with FSC_COLOR (which I'm using successfully
elsewhere in my program), but that just seemed to confuse things
entirely.

Ideally, what I'd like is to have a white background, with black text
and lines, and then with the colors for the contours plotting
correctly. I'm sure this must be possible, but I'm not sure how.

Any help would be much appreciated,

Robin
University of Southampton, UK

PRO MAP_PLOT_DATA, azimuths, zeniths, dns, title
; Set positions for drawing the plot and the colourbar
draw_position = [.10, .07, .80, .90]
cbar_position = [.85, .07, .88, .90]

; Set the map projection to orthographic, looking down from the
north pole
; The REVERSE=1 and the third numeric parameter (180) ensure that N,
E, S and W are at the appropriate locations
MAP_SET, /ORTHOGRAPHIC, 90, 0, 180, REVERSE=1, /ISOTROPIC,
title=title, position=draw_position, color=1

; Load colours into colortable
device, decomposed=0
loadct, 13
TVLCT, 0, 0, 0, 1 ; Drawing colour
TVLCT, 255, 255, 255, 0 ; Background colour

; Calculate 100 levels for the contouring
range = MAX(dns) - MIN(dns)
levels = indgen(100) * (range/100)

; Plot the contours from the irregular data
contour, dns, azimuths, zeniths, /irregular, /overplot,
levels=levels, /cell_fill, position=draw_position, color=1

; Plot the grid over the top of the data
map_grid, /grid, londel=45, latdel=20, color=1,
position=draw_position

colorbar, /vertical, /right, range=[min(dns), max(dns)],
position=cbar_position, title="Digital Number", color=1
END
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Strange array subscripting error
Next Topic: Re: maximum likelihood sensitivity to outliers

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

Current Time: Wed Oct 08 17:31:22 PDT 2025

Total time taken to generate the page: 0.00511 seconds