Re: muli-plot and labelbar alignment

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Mon, 14 May 2007 21:09:59 -0600

Hi Sang-ki,

It sounds like you are trying to position individual plots that are not
the same size as each other. If so, you shouldn't be using gsn_panel,
because this function is really not meant for positioning single plots,
or for positioning plots that aren't the same size.

Instead, you can use the vpXF, vpYF, vpWidthF, and vpHeightF resources
to position the top left corner of the plot where you want it, and then
to size it however you want. You don't need to set both vpWidthF and
vpHeightF; if you set one, the other will resize accordingly to keep
the aspect ratio.

See example 3 at: http://www.ncl.ucar.edu/Applications/unique.shtml for
an example of how to use the vp*resources to position and size your
plots. The vpXF/vpYF resources indicate the location of the top left
corner of your plot axes, and not the top left corner of the bounding
box that encloses the full plot and all of its annotations. This
enables you to align plots by their axes, which is usually what folks
want.

--Mary

On May 14, 2007, at 4:02 PM, Sang-ki Lee wrote:

> Hi,
>
> I use gsnPanelTop, gsnPanelBottom, gsnPanelLeft and gsnPanelRight
> resources to place multi-panel plots.
>
> For example:
> pan2_at_gsnPanelTop = 0.950
> pan2_at_gsnPanelBottom = 0.600
> pan2_at_gsnPanelLeft = 0.000
> pan2_at_gsnPanelRight = 1.000
> gsn_panel(wks,plot_a,(/1,1/),pan2)
> pan2_at_gsnPanelTop = 0.500
> pan2_at_gsnPanelBottom = 0.150
> pan2_at_gsnPanelLeft = 0.000
> pan2_at_gsnPanelRight = 1.000
> gsn_panel(wks,plot_b,(/1,1/),pan2)
>
> But, unless the plot_a and Plot_b in the above example have the same
> styles, sometime, the two plots are not exactly aligned. Then, I have
> to experiments with the "gsnPanelTop[Bottom, Left and Right] to align
> them. This is a very tedious job.
>
> It would be better if "gsnPanelTop" indicate the NDCGrid point of
> the top X axis. Likewise, "gsnPanelLeft" should indicate the NDCGrid
> point of the left Y axis. Is there any way to do that?
>
> In ferret, this can be done by using "/axis" option:
> define viewport/axes/xlim=0.100,0.490/ylim=0.765, 0.900/text=0.6 v01
>
> Related to this issue is labelbar. I would like to have the label bar
> that starts at the left X axis and ends at Right X axis. To achieve
> this, I have to change lbLeftMarginF and lbRightMarginF for each plot.
>
> Thank you.
>
> Sang-ki
> ----------------------------------------------------------------------
> Dr. Sang-ki Lee
> RSMAS/CIMAS
> University of Miami
> 4600 Rickenbacker Causeway
> Miami, FL 33149 USA
> Tel) 305-361-4521
> Fax) 305-361-4412
> E-mail) sang-ki.lee_at_noaa.gov
> Homepage) http://www.aoml.noaa.gov/phod/people/sklee.html
> ----------------------------------------------------------------------
> Mailing-address:
> Dr. Sang-ki Lee
> AOML/PHOD
> 4301 Rickenbacker Causeway
> Miami, FL, 33149 USA
> ----------------------------------------------------------------------
> _______________________________________________
> ncl-talk mailing list
> ncl-talk_at_ucar.edu
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

_______________________________________________
ncl-talk mailing list
ncl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Mon May 14 2007 - 21:09:59 MDT

This archive was generated by hypermail 2.2.0 : Mon May 21 2007 - 09:22:55 MDT