maye writes:
> David's TVSCALE and TVIMAGE programs nicely calculate the positions
> required for multiplots (using !p.multi), but I would like to control
> the output-size per assigned space in the multiplot window.
> Example:
> If I set
> !p.multi=[0,2,2]
> so that I have 4 subframes to fill, I would like to tell TVSCALE (or
> TVIMAGE), that it should not use the whole of that quarter window, but
> only the lower 80% or so of it, so that I have space to put a colorbar
> on top of each subframes.
> But the position keyword of TVSCALE seems to be ignored for
> multiplots?
> So how could I do it? I basically would like 4 subframes each having
> their own colorbar on top of the displayed image.
Alright, in an ongoing effort to keep TVIMAGE and TVSCALE
as the number one TV replacements in the IDL universe,
I have added the ability to do what you want to do here.
Now, if you use the POSITION keyword with either TVIMAGE
or TVSCALE, and you are displaying images with !P.MULTI,
the POSITION keyword will position the image with respect
to the "window" specified for the image by !P.MULTI. (Since
no one in their right mind would be using the POSITION
keyword and !P.MULTI together, I figure this won't affect
anyone currently using the TVIMAGE command.)
So, to put four images and associated colorbars into a
window with !P.MULTI, you would write code something
like this:
;*********************************************************
image = Dist(200)
!P.Multi=[0,2,2]
p = [0.02, 0.3, 0.98, 0.98]
LoadCT, 0
TVImage, image, Position=p
Colorbar, Position=[p[0], p[1]-0.1, p[2], p[1]-0.05]
p = [0.02, 0.3, 0.98, 0.98]
LoadCT, 5
TVImage, image, Position=p
Colorbar, Position=[p[0], p[1]-0.1, p[2], p[1]-0.05]
p = [0.02, 0.3, 0.98, 0.98]
LoadCT, 2
TVImage, image, Position=p
Colorbar, Position=[p[0], p[1]-0.1, p[2], p[1]-0.05]
p = [0.02, 0.3, 0.98, 0.98]
LoadCT, 3
TVImage, image, Position=p
Colorbar, Position=[p[0], p[1]-0.1, p[2], p[1]-0.05]
!P.Multi = 0
;*********************************************************
You can find the updated programs here:
http://www.dfanning.com/programs/tvimage.pro
http://www.dfanning.com/programs/tvscale.pro
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|