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

Home » Public Forums » archive » Multiple color plots, same color bar
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Multiple color plots, same color bar [message #86828 is a reply to message #86827] Thu, 05 December 2013 14:57 Go to previous messageGo to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Lim writes:

>
> Dear all,
> I was wondering if someone could help me with a problem using one color bar for multiple plots with different ranges of colors. My example bellow produces two panels and one color bar. However the color bar does not match both panels but only the first one (I1 values).
> For I1 and I2, I need to do:
> 100-200=red
> 201-300=orange
> 301-400=yellow
> 401-500=green
> 501-600=blue
>
> therefore, using a color table from 0 to 600, the second panel should not have any blue color.
>
> I will appreciate any assistance.

You want this:

pro mci

X1=[2, 4, 5, 6, 7, 8]
Y1=[20, 40, 45, 30, 10, 5]
I1=[100,200,300,400,500,600]

X2=[3, 4.5, 5.5, 6.5, 7.5, 8.5]
Y2=[22, 25, 30, 33, 20, 8]
I2=[150,175,250,280,290,450]

cgLoadCT, 33, /reverse
clr1 = BytScl(i1, MIN=100, MAX=600)
clr2 = BytScl(i2, MIN=100, MAX=600)

cgWindow
pos1=[0.1,0.1,0.45,0.75]
pos2=[0.55,0.1,0.9,0.75]
;graph 1
cgPlot, X1, Y1, /Nodata, Xtitle='X', Ytitle='Y', $
position=pos1,/NoErase,/AddCMD
cgPlotS, X1, Y1, Psym=16,symsize=2,color=clr1,/AddCMD
;graph 2
cgplot,X2,Y2, /Nodata, Xtitle='X', Ytitle='Y', $
position=pos2,/NoErase, /AddCMD
cgPlotS, X2, Y2,Psym=16,symsize=2,color=clr2,/AddCMD
;the colorbar
cgColorbar, Divisions=5, Format='(I3)', Range=[100,600],$
/AddCMD , TLOCATION='Top', Title='I'

End

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thue. ("Perhaps thou speakest truth.")
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: structure references
Next Topic: How to close all of figures at the same time using IDL command?

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

Current Time: Fri Oct 10 09:19:56 PDT 2025

Total time taken to generate the page: 0.63930 seconds