robintw
2009-07-08 08:49:16 UTC
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
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