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

Home » Public Forums » archive » Re: Trouble with positioning cgColorbars while using !P.Multi
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: Trouble with positioning cgColorbars while using !P.Multi [message #82496] Wed, 12 December 2012 12:30
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
David Fanning writes:

> Acutally, if it took you 30 seconds to rough out where
> four plots are suppose to go in a window, I think you would probably
> be taking too much time, but maybe we have different ideas
> of what is "daunting". :-)

Here you go. Took me five minutes, but tweak as needed. :-)

PS_Start
cgLoadCT, 4, /Brewer, /Reverse
cgdisplay
p = Fltarr(4, 4)
p[*,0] = [0.10, 0.55, 0.45, 0.85]
p[*,1] = [0.55, 0.55, 0.95, 0.85]
p[*,2] = [0.10, 0.10, 0.45, 0.40]
p[*,3] = [0.55, 0.10, 0.95, 0.40]
cbp = FltArr(4,4)
cbp[*,0] = [0.10, 0.90, 0.45, 0.93]
cbp[*,1] = [0.55, 0.90, 0.95, 0.93]
cbp[*,2] = [0.10, 0.45, 0.45, 0.48]
cbp[*,3] = [0.55, 0.45, 0.95, 0.48]

FOR j=0,3 DO BEGIN
cgContour, cgDemoData(18), /Fill, Position=p[*,j], NOERASE=(j NE 0)
cgColorbar, position=cbp[*,j]
ENDFOR
PS_End, /PNG
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.")
Re: Trouble with positioning cgColorbars while using !P.Multi [message #82497 is a reply to message #82496] Wed, 12 December 2012 11:57 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Leah Huk writes:

> I am creating some postscript files with 4 contour plots each using !p.multi. I would like each plot to have it's own colorbar positioned with it as they all have unique ranges. I've dug around and found that use of the POSITION keyword is not compatible with !p.multi. Is there another way for me to position each colorbar with it's corresponding plot, instead of all on top of each other and in the middle of the plots? Or am I doomed to use the position keyword for every
plot and every colorbar? This seems daunting to implement; I have my cgContour and colorbar command embedded within a set of for loops for ease of plotting many many parameter "slices" of a rather large data grid.
>

You are pretty much doomed.

Acutally, if it took you 30 seconds to rough out where
four plots are suppose to go in a window, I think you would probably
be taking too much time, but maybe we have different ideas
of what is "daunting". :-)

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.")
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: array manipulation (TOTAL-ing or MEDIAN-ing) in uneven bins
Next Topic: plot z vector on x-y plot

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

Current Time: Thu Oct 09 07:55:09 PDT 2025

Total time taken to generate the page: 1.36096 seconds