Re: YR Label does show with vp settings

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Tue Jan 21 2014 - 15:41:54 MST

On Jan 21, 2014, at 3:30 PM, Xin Xi <xxi@gatech.edu> wrote:

> Thanks, Mary! I was also able to tune the vpXF/YF to make the YR show up.
>
> I notice that this method only works for gsn_csm_xy2. It does not work for the method of using gsn_csm_xy (for bar) and gsn_add_annotation (for curves), which is the way to go if multiple curves are overlaid to a bar plot. Plus, modifying vp setting in that case will change the fontheight of labels/axis.

You're right, if you are attaching additional stuff to the outside of a plot using gsn_add_annotation, then the method I mentioned won't work.

But, I think you should be able to still set the vp resources as I described, and then instead of using gsnMaximize, you can use maximize_output.

See these example for more information:

http://www.ncl.ucar.edu/Applications/xy.shtml#ex26 (xy_26.ncl and xy_27.ncl)

Note that in this case, you do *not* want to set gsnMaximize to True.

--Mary

> Xin
>
>
> On Tue, Jan 21, 2014 at 5:15 PM, Mary Haley <haley@ucar.edu> wrote:
> Hi Xin,
>
> The key here is to simply set vpHeightF and vpWidthF to the appropriate ratio that you want, but make vpWidthF small enough so that your plot completely fits in the frame.
> Then, also set gsnMaximize to True so that your plot will be maximized for the frame, but it will still keep the ratio.
>
> Since you want a ratio of 0.8 to 0.3, then what you can do is try something smaller for the width, and use the ratio to calculate the height:
>
> ratio = 0.3/0.8
> res@vpWidth = 0.7
> res@vpHeightF = ratio * res@vpWidth
>
> If it's still too big, then keep making vpWidthF smaller.
>
> --Mary
>
> On Jan 21, 2014, at 1:47 PM, Xin Xi <xxi@gatech.edu> wrote:
>
> > Hi,
> >
> > While I set vpWidthF = 0.8 and vpHeightF = 0.3 to make the plot look nicer, the YR labels and title wont show. How do I avoid this? (see pictures)
> >
> > I tried gsn_csm_xy2, and gsn_csm_xy with gsn_add_annotation. Both have the same error.
> >
> > Thanks,
> > Xin
> > <Drought_MEI-1.png><Drought_MEI-2.png>_______________________________________________
> > ncl-talk mailing list
> > List instructions, subscriber options, unsubscribe:
> > http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
>
>
> --
> Xin Xi
> School of Earth and Atmospheric Sciences
> Georgia Institute of Technology
> 311 Ferst Drive, Atlanta, GA 30332-0340
> _______________________________________________
> 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 Tue Jan 21 15:42:06 2014

This archive was generated by hypermail 2.1.8 : Tue Jan 21 2014 - 15:57:30 MST