[ncl-talk] Panel Plots problem

Mary Haley haley at ucar.edu
Thu Dec 15 09:51:29 MST 2016


​Geeta,

As Adam said, gsn_panel is not going to change the shape of your plots
simply to make them the same size. It will make them *smaller* so they can
fit on one page, but it will maintain the aspect ratio of the width to the
height.

NCL will never alter your plots to change the aspect ratio, unless you
explicitly tell it to, via vpWidthF/vpHeightF resources or, in the cases of
maps, by additionally setting mpShapeMode to "FreeAspect".

This is not bug! Skewing the aspect ratio of your plots can be a big deal
scientifically, depending on what kind of data you are looking at, so NCL
requires that you do this explicitly.

gsn_panel is meant to be used on plots that are very close to the same
size. If you give it plots of different widths and heights, it doesn't know
anything about this, and simply scales down the size of the other plots
based on the size it retrieves from the first plot, but without changing
the aspect ratio. Again, this is not a bug, it's simply how gsn_panel
works.  It will line up the top left corners of all the plots for each row.

Adam's solution is the only way you can get plots with different lat/lon
ranges to be the same size.

If you don't want to skew the aspect ratio of your plots, then one way to
make them more visible is to use a different paneling configuration. You
have 8 plots and are telling it to panel 6 of them in the first row, and
the rest in the second row. This doesn't give you much room.

I would suggest using a 3 x 3 configuration, which uses three rows, and
hence your plots end up larger:

   Panelres      =  True
   Panelres at gsnPanelScalePlotIndex = 7
                        gsn_panel(Wks,Plot,(/3,3/),Panelres)


Since your last plot (plot index 7) is the largest one, I set the special
gsnPanelScalePlotIndex to this plot index, so that the scaling will be
based on this plot, and not the first one. This will keep the plots from
running into each other.

If you don't like the layout of the plots, you can tweak the locations of
each plot using the special gsnPanelXF and gsnPanelYF resources.  See
panel_19.ncl and maponly_23.ncl at:

http://www.ncl.ucar.edu/Applications/panel.shtml#19
http://www.ncl.ucar.edu/Applications/maponly.shtml#ex23

--Mary


On Wed, Dec 14, 2016 at 8:05 AM, Geeta Geeta <geetag54 at yahoo.com> wrote:

> thanks Adam for the clues.
> It worked well.
> But I did not face any problem with gsn_panel earlier when the lat-lon
> were fixed. I did not use any resource to plot the figures of different
> sizes. so was it the problem with gsn_panel?
> Only in this case when my lat-lon are different, I faced issues with
> gsn_panel.
>
>
> Geeta.
>
>
> On Tuesday, 13 December 2016 11:49 PM, Adam Phillips <asphilli at ucar.edu>
> wrote:
>
>
> Hi Geeta,
> NCL will not distort the map areas shown to make each paneled plot the
> same size unless you tell it to. To do this you can set the
> mpShapeMode/vpWidthF/vpHeightF resources as is shown in example #6 here:
> http://www.ncl.ucar.edu/Applications/viewport.shtml#ex6
>
> Note that that example bases the vpWidthF/vpHeightF settings for the
> second plot off of the first by drawing/advancing the frame (using
> gsn_panel) and then retrieving the width/height of the first plot. You do
> not need to do this. You can simply set vpWidthF/vpHeightF to whatever you
> want (and of course set mpShapeMode = "FreeAspect").
>
> Hope that helps. If you have any further questions please write to the
> ncl-talk email list.
> Adam
>
> On Tue, Dec 13, 2016 at 9:54 AM, Geeta Geeta <geetag54 at yahoo.com> wrote:
>
> I am making a panel plot in which for each figure, I have different ranges
> of lat/lon.
> I donot know why the plots are not of same size.
>
>
>
>
> thanks
>
> Geeta.
>
> ______________________________ _________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/ mailman/listinfo/ncl-talk
> <http://mailman.ucar.edu/mailman/listinfo/ncl-talk>
>
>
>
>
> --
> Adam Phillips
> Associate Scientist,  Climate and Global Dynamics Laboratory, NCAR
> www.cgd.ucar.edu/staff/asphilli/   303-497-1726 <(303)%20497-1726>
>
> <http://www.cgd.ucar.edu/staff/asphilli>
>
>
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20161215/3560eb99/attachment.html 


More information about the ncl-talk mailing list