sasha.mozgova@gmail.com writes:
> I have quite restrained experience with use of Contour Plots, so the following represents a problem for me.
>
> I need to make 5 different contour plots with the common range of colors. My understanding is that IDL takes the minimum and the maximum of the input arrays and assigns to them the first and the last colors, distributing the other colors in between. Now, I have 5 arrays, with different minimums and maximums o each one, and I would like to produce contour plots that would be directly comparable with eye, i.e. I would like them to have a common color range.
Well, you don't want IDL dictating how it is going
to do things to you. You want to take change of this! ;-)
Assuming that the colors actually mean something (not
clear if this is the case from your explanation), I would
find the minimum and the maximum of the five data sets all
together. Then I would decide how to partition that space
into some reasonable number of divisions. Suppose that the
minimum is 1427 and the maximum is 1585. Then, I might decide
to contour each data set from 1400 to 1600 in 10 steps of
20 units each. These will be your contour levels:
nlevels = 10
step = 20
levels = Indgen(nlevels)*step+1400
Next, I would load 10 contour colors:
cgLoadCT, 33, NColors=nlevels, Bottom=1
Then, I would do my five contour plots, using these levels
and colors:
cgContour, data1, Levels=levels, C_Colors=Indgen(nlevels)+1, ...
cgContour, data2, Levels=levels, C_Colors=Indgen(nlevels)+1, ...
cgContour, data3, Levels=levels, C_Colors=Indgen(nlevels)+1, ...
cgContour, data4, Levels=levels, C_Colors=Indgen(nlevels)+1, ...
cgContour, data5, Levels=levels, C_Colors=Indgen(nlevels)+1, ...
And I would finish it with a color bar.
cgColorbar, NColors=10, Bottom=1, Divisions=10, /Discrete, $
TickNames = StrTrim([levels, levels[ncolors-1]+step],2), ...
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|