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

Home » Public Forums » archive » Re: TWO DIFFERENT COLOR TABLES IN SAME WINDOW
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: TWO DIFFERENT COLOR TABLES IN SAME WINDOW [message #21780] Thu, 21 September 2000 00:00
davidf is currently offline  davidf
Messages: 2866
Registered: September 1996
Senior Member
Mark C. (mychan@petro-canada.ca) writes:

> I have opened ONE window, plotted an image in the upper part of the window,
> and will like to plot a line graph in the lower portion of the same window.
>
> I have found directions on how to use different color tables in different
> windows which are displayed at the same time. Is there a way to use
> different color tables on two different plots (e.g. one image, the other a
> line graph) in the same window?

You better think about getting one of my books, Mark. :-)

Here is an example program that works the same way on
8-bit and 24-bit displays, with color decomposition turned
on or off. You need GetColor and TVImage from my web
page to run the code.

http://www.dfanning.com/programs/getcolor.pro
http://www.dfanning.com/programs/tvimage.pro

Cheers,

David

PRO Example

; Get example image data.

file = Filepath('worldelv.dat', SubDirectory=['examples','data'])
image = BytArr(360,360)
OpenR, lun, file, /Get_Lun
ReadU, lun, image
Free_Lun, lun

; Load drawing colors yellow, green, charcoal.

yellow = GetColor("yellow", !D.Table_Size-2)
green = GetColor("green", !D.Table_Size-3)
charcoal = GetColor("charcoal", !D.Table_Size-4)

; Load image colors.

LoadCT, 3, NColors=!D.Table_Size-4

; Display image histogram plot with image underneath.

!P.Multi = [0, 1, 2]

histoData = Histogram(image)
Plot, histoData, Color=green, Background=charcoal, $
/NoData, Max_Value=5000
OPlot, histoData, Color=yellow

TVImage, BytScl(image, Top=!D.Table_Size-5)

; Clean up.

!P.Multi=0

END

--
David Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438 E-Mail: davidf@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: IDL 5.3 serious problem: save files sneakily restored
Next Topic: Re: Reading from process pipes in IDL?

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

Current Time: Fri Oct 10 00:35:48 PDT 2025

Total time taken to generate the page: 0.48175 seconds