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

Home » Public Forums » archive » Re: 24-bit color contour
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
Re: 24-bit color contour [message #27879] Sat, 10 November 2001 07:38
David Fanning is currently offline  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
Re: 24-bit color contour [message #27880 is a reply to message #27879] Sat, 10 November 2001 00:13 Go to previous message
tom is currently offline  tom
Messages: 28
Registered: April 1995
Junior Member
Thanks.
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?

"David Fanning" <david@dfanning.com> wrote in message
news:MPG.165644a245c2f9e5989763@news.frii.com...
> tom (tom2959@21cn.com) writes:
>
>> Hi, is it possible for me to draw a 24-bits color filled contour plot on
a
>> 24-bits screen or PS file? It is usually a 8-bits contour or grey
contour.
>
> The question that comes up for me is not "is it possible"?
> But, rather "why in the world would you want to do it?"
>
> Let me see if I understand this. You want a filled
> contour plot with more than 256 colors, implying that
> you are going to use more than 256 contour intervals.
> Have you given any thought to how big that window is
> going to have to be to get any kind of resolution on
> your filled contour plot?
>
> Or, do you mean you wish to specify the contour
> colors as 24-bit values? This is possible in object
> graphics, but no one I know uses contour plots in
> object graphics because there is no way to label
> contour intervals there. It is not possible in
> direct graphics, but again, I can't think of any
> reason *why* it should be possible. No practical
> filled contour plot would have more than 256 colors.
> And even it it did, on a 24-bit display you would
> just change color tables and continue layering on
> more contours in more colors.
>
> Perhaps I'm missing the gist of this question
> entirely. All I can say in my defense is that
> it *is* Friday night. :-)
>
> 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
Re: 24-bit color contour [message #27881 is a reply to message #27880] Fri, 09 November 2001 18:53 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
tom (tom2959@21cn.com) writes:

> Hi, is it possible for me to draw a 24-bits color filled contour plot on a
> 24-bits screen or PS file? It is usually a 8-bits contour or grey contour.

The question that comes up for me is not "is it possible"?
But, rather "why in the world would you want to do it?"

Let me see if I understand this. You want a filled
contour plot with more than 256 colors, implying that
you are going to use more than 256 contour intervals.
Have you given any thought to how big that window is
going to have to be to get any kind of resolution on
your filled contour plot?

Or, do you mean you wish to specify the contour
colors as 24-bit values? This is possible in object
graphics, but no one I know uses contour plots in
object graphics because there is no way to label
contour intervals there. It is not possible in
direct graphics, but again, I can't think of any
reason *why* it should be possible. No practical
filled contour plot would have more than 256 colors.
And even it it did, on a 24-bit display you would
just change color tables and continue layering on
more contours in more colors.

Perhaps I'm missing the gist of this question
entirely. All I can say in my defense is that
it *is* Friday night. :-)

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
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: IDL SpecII results
Next Topic: problem with "xloadct"

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

Current Time: Sat Oct 11 08:12:50 PDT 2025

Total time taken to generate the page: 1.19916 seconds