Re: Question about the TickMark resources and the changes of viewport width.

From: <ph0007_at_nyahnyahspammersnyahnyah>
Date: Wed Nov 18 2009 - 19:32:37 MST

Hi Mary,

Thanks for your explanation.

To avoid unnecessary trouble, I explicitly specify the fontsizes of tickmark labels and the tickmark lengths. It works fine. There are no more problems.

Huang Ping
2009-11-19






发件人: Mary Haley
发送时间: 2009-11-17 07:53:36
收件人: ph0007
抄送:
主题: Re: [ncl-talk] Question about the TickMark resources and the changes of viewport width.
 
Hi Huang Ping,


Yes, there is a difference when you are doing a map plot, and I believe the documentation states this. I'm not sure exactly how it is difference, however. The
issue is that map plots want to keep their aspect ratio, so if you start trying to change the width and height, it may try to change the tickmark lengths too.


However, I think if you set those tm resources, you should be able to control the length of them.


If your program is not doing what you expect, then if you can send me the full script and data, I can take a look at it.


--Mary


On Nov 16, 2009, at 1:08 AM, ph0007@ustc.edu wrote:


Dear Mary Haley

Thanks for your reply. And your two advises work well.

As for my scripts' different behave, I check them again. There are no other resource except for TickMark. And I used the plot function "gsn_csm_contour_map", which contour with map.

However, when I use the plot function without map such as "gsn_csm_contour" and "gsn_csm_xy", the plot result is not beyond the states that " the tickmark lengths change when the viewport is resized, unless you set the tmXB/YLMajorLengthF resources".

And for the plot function "gsn_csm_contour_map", just the lables and strings have strange behave and the tmXB/YLMajorLengthF change with the viewport sizes. (see the script hp_tm1.ncl, and plot output 1.ps).

There are special character about funtion gsn_csm_contour_map?



2009-11-16






发件人: Mary Haley
发送时间: 2009-11-16 10:36:08
收件人: 黄平
抄送: ncl-talk
主题: Re: [ncl-talk] Question about the TickMark resources and the changes of viewport width.
Dear Huang Ping,


It may not be easy to find, but the documentation on the TickMark resource page states that the tickmark lengths change when the viewport is resized, unless you set the tmXB/YLMajorLengthF resources. For example:


   tmXBMajorLengthF - Sets the length of the X-Axis bottom major tick marks in NDC coordinates. This length scales with changes to the viewport height, unless you explicitly set tmXBMajorLengthF at the same time.


There are two ways you can set these resources, then. You can set the tmXBMajorLengthF, tmXBMinorLengthF, tmXBMajorOutwardLengthF, and tmXBMinorOutwardLengthF resources (and same for the YL resources) to fixed values, or you can go ahead and create the plot, retrieve the values used for these resources, and then set them along with when you resize the viewport.


Please see the attached "tm1.ncl" script for an example of how to retrieve and then set these resources values, and the "tm2.ncl" script for an example of how to set them up front.


As for why your script below was behaving differently, I'm not sure. I would have to see the whole script to make sure other resources weren't being set that might affect the tickmark lengths
<1.ps><hp_tm1.ncl><sst.nc>

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Wed Nov 18 19:33:00 2009

This archive was generated by hypermail 2.1.8 : Mon Nov 23 2009 - 12:24:02 MST