Re: overlay plot

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Wed Dec 21 2011 - 05:40:18 MST

On Dec 20, 2011, at 7:26 PM, juki juki wrote:

> Mary, thanks for the answer ,
>
> However, it seems the overlaid plot is still not good, the overlaid
> plot cange to landscape ( I hope portrait, because I will make
> multiplot after this).

The reason for this is that you've moved the labelbar so far away from
the plot that the whole plot area is now wider than it is high, so
when you set gsnMaximize to True, it rotates it to landscape to better
fill the page.

I assume by "multiplot" you mean that you plan to call gsn_panel? If
so, you can control the rotation by setting the gsnPaperOrientation
resource to "portait" when you set the panel resources.

Or, do you mean you plan to do multiple overlays? If so, then you can
do this in the maximize_output call:

. . .
   vector_wind =
gsn_csm_vector(wks,data_U(lat|:,lon|:),data_V(lat|:,lon|:),vcres)
   overlay(plot_olr,vector_wind)

   pres = True
   pres@gsnPaperOrientation = "portrait"
   maximize_output(wks,pres)

I'm not sure why you are moving the labelbar so far away from the
plot, but if you don't want this, then remove the line:

   res@pmLabelBarOrthogonalPosF = .25

>
> I also use, res@gsnMajorLatSpacing = 10, res@gsnMajorLonSpacing =
> 10, but also no change in the spacing. I send again the plot and the
> current code, probably any other suggestion for improving it. thanks
> again for all..

This is because you didn't remove the "pmTickMarkDisplayMode"
resource. You can't use the Lat/LonSpacing resources if this resource
is set to "Always".

I've attached a modified version of your script that:

   - fixes the lat/lon spacing
   - doesn't draw the individual plots
   - moves the labelbar closer to the plot
   - draws everything in portrait mode

See the attached script and image.

--Mary

>
>
> Regards,
> Juky
>
> From: Mary Haley <haley@ucar.edu>
> To: juki juki <juky_emc2@yahoo.com>
> Cc: "ncl-talk@ucar.edu" <ncl-talk@ucar.edu>
> Sent: Wednesday, December 21, 2011 2:26 AM
> Subject: Re: overlay plot
>
>
> On Dec 20, 2011, at 2:21 AM, juki juki wrote:
>
>> Hi all,
>>
>> I come to you again and hope your sharing. I want to plot olr data
>> and wind data together using overlay. The code and the input data
>> are enclosed. By this email, I would like to ask several questions:
>>
>> (1). I think my attached code is correct, but when I run it was
>> stated that "can not be overlay", how to make it overlayable ?
>
> Dear Juky,
>
> You are almost there. You can't overlay one map on another. The
> overlay plot needs to be a non-map plot.
>
> Simply change:
>
> vector_wind =
> gsn_csm_vector_map_ce
> (wks,data_U(lat|:,lon|:),data_V(lat|:,lon|:),vcres)
>
> to:
>
> vector_wind =
> gsn_csm_vector(wks,data_U(lat|:,lon|:),data_V(lat|:,lon|:),vcres)
>
> You also don't want tp set any mp resources when you call
> gsn_csm_vector. You've already set up the map when you created the
> contour plot.
>
>
>> (2). How to set the space of the Thick of X and Y axis of the
>> plot ? For example we can set the latitude and longitude as follow:
>>
>> res@mpMinLatF = -10 ;
>> res@mpMaxLatF = 10.
>> res@mpMinLonF = 80.
>> res@mpMaxLonF = 160.
>>
>> For example, if we need to set the spaceLonF = 10, how to do it ?
>
> You are setting res@pmTickMarkDisplayMode = "Always" which doesn't
> allow
> for much customization. To be able to set the lat/lon spacing, don't
> set the
> pmTickMarkDisplayMode resource, and set:
>
> res@gsnMajorLatSpacing = 10
> res@gsnMajorLonSpacing = 10
>
>>
>> (3) Assume we want to make multiplot as:
>> gsn_panel(wks,plots,(/4,1/),pres), how to set the colorbar size and
>> location ?, we can set as:
>>
>> pres = True ; Set panel resources.
>> pres@gsnPanelLabelBar = True ; Turn on panel labelbar.
>> pres@lbOrientation = "Vertical"
>>
>> But the size is very large (it is very long), for example if we
>> need the location of the colorbar is at right side of first figure
>> and the size is the same as the size of the first figure (its
>> height), how to do it ?
>
> You can set the pres@pmLabelBarWidthF resource to something between
> 0. and 1. to shorten it. Try a value of something like 0.6 to start
> with.
>
> --Mary
>
>>
>> Sorry, too many questions, thanks for nice attention...
>>
>> Cheers
>> Juky
>>
>>
>> <
>> juky_overlay_test
>> .ncl
>> >
>> <
>> djfOLR
>> .txt
>> >
>> <vwnd1.txt><uwnd1.txt>_______________________________________________
>> ncl-talk mailing list
>> List instructions, subscriber options, unsubscribe:
>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
>
> <juky_overlay_test.ps><juky_overlay_test.ncl>
> _______________________________________________
> 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 Wed Dec 21 05:40:50 2011

This archive was generated by hypermail 2.1.8 : Wed Dec 21 2011 - 10:44:06 MST