Re: How to fix plot size and shape independent of paper size

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Fri May 03 2013 - 08:31:52 MDT

Hi Doug,

When you say "plot size", do you mean the box that contains the plot, and not all the tickmarks and labels around it?

If so, *and* the axes limits are the same for every plot, then the solution may be simply to *not* set res@gsnMaximize to True, because when gsnMaximize = False (the default), the plot should be drawn with the same size and in the same space every time.

I've attached a simple contour plot script that illustrates this. You will see if gsnMaximize is not set to True, then the plot is drawn to the same area every time, even with the extra long title in there. Try setting res@gsnMaximize = True to see what happens to the two plots when drawn on top of each other.

Another way you can force the plots to be the same size is by querying the size and location of the first plot (using a "getvalues" block to retrieve the vpXXXX resource values), and making sure that all other plots have the same vpXXX values.

For this one, you can set res@gsnMaximize=True for the first plot, but don't set it for subequent plots, because then the vpXXX resources will recalculated by gsn_csm_contour.

I've attached a second script (based on the first one) that illustrates this.

--Mary

On May 2, 2013, at 10:54 AM, Douglas Lowe wrote:

> Hi,
>
> I'm working on plotting wrf data using ncl with the purpose of creating semi-transparent png images for layering one on top of another. For this we need the plot size to always be the same size and shape - which is difficult to do if it is set using the paper size (and can change if the title string is too long, or the colorbar labels are different lengths). Is there anyway with ncl to set the plot size independently of the paper size?
>
> Thanks,
> Doug
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk

Received on Fri May 3 08:32:00 2013

This archive was generated by hypermail 2.1.8 : Tue May 07 2013 - 08:38:33 MDT