Re: 24-bit color contour [message #27879] |
Sat, 10 November 2001 07:38  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
tom (tom2959@21cn.com) writes:
> Sometimes, the contour plot was displayed by adding on a TV or TVscl plot.
> For example,
> data=fltarr(n,n)
> tv,data,/true
> contour,data
> may be wrong. How to to display the data in a 24 bit color?
Well, your example is certainly wrong, because
a 24-bit image is a 3D array, not a 2D. But there
is no problem at all putting a 24-bit image underneath
a contour plot. The question really is this: what are
you going to contour? Not the 24-bit image, since that
is made up of color triples and doesn't represent
(almost certainly) a physical quantity.
If you had a 24-bit image that you will to place
under a contour plot, and a 2D array of some
physical quantity you wish to contour, then you
can do this:
plotPosition =[0.15, 0.15, 0.9, 0.9]
TVImage, image24, Position=plotPosition
Contour, data, /NoErase, XStyle=1, YStyle=1, $
Position=plotPosition
That will work on the display and in PostScript.
(In fact, the same commands will work with a 2D
image as well.) The TVImage program can be found
on my web page:
http://www.dfanning.com/programs/tvimage.pro
Cheers,
David
--
David W. Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438, E-mail: david@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
|
|
|