RE: [ncl-talk] Truncation of tmXBLabels [SEC=UNCLASSIFIED]

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Tue, 22 Apr 2008 08:59:36 -0600 (MDT)

Hi all,

Debasish's suggestions should normally work. However, since
gsn_histogram uses a mode (tmXBMode) of "Explicit", and resources
"tmXBLabels" and "tmXBValues" to explicitly label the tickmarks, the
resources for setting precision will not have any effect.

The reason this mode is used is because the actual values where the
tickmarks are appearing are different than the labels themselves. The
actual tickmark values go from 0.0 to 1.0 internally, so in order
to put a value of say, "21.5" at the first tickmark position (value 0.0),
you need to use the explicit mode.

You can work around this in a kludgy fashion, by:

    - generating the histogram (but not drawing it)
    - retrieving the values used for the tickmarks labels
    - formatting these values to whatever labels you want
    - setting "tmXBLabels" to these new labels
    - drawing the plot and advancing the frame

I've attached a "hist.ncl" example to show how this works. I'll
include this on the applications page. Maybe sometime I'll try to
improve this process by adding some special formatting resources.

--Mary

On Tue, 22 Apr 2008, Harun Rashid wrote:

  Hi Debasish,
>
> Thanks for your suggestion regarding truncation of xlabels. However,
> these resources do not seem to work with "gsn_histogram" (I'm plotting
> histograms), although they work with "gsn_csm_xy".
>
> Cheers,
> Harun
>
>
> ===================================================================
> Dr. M. Harun Ar Rashid
> Centre for Australian Weather and Climate Research Email:
> h.rashid_at_bom.gov.au
> PO Box 1289K
> Tel : +61 3 9669 4550
> Melbourne, Victoria 3001
> Fax : +61 3 9669 4660
> Australia
> http://www.bom.gov.au/bmrc
> ===================================================================
>
>
>
>
> ________________________________
>
> From: Debasish Pai Mazumder [mailto:debasish_at_gi.alaska.edu]
> Sent: Tuesday, 22 April 2008 14:18
> To: Harun Rashid; ncl-talk_at_ucar.edu
> Subject: RE: [ncl-talk] Truncation of tmXBLabels [SEC=UNCLASSIFIED]
>
>
>
> Dear Harun,
>
>
>
> Try this,
>
>
>
> res_at_tmXTAutoPrecision = False
> res_at_tmXTPrecision = 2
>
>
>
> This limits the X axis labels to two significant digit
>
>
>
> Thanks
>
>
>
> Debasish
>
> ________________________________
>
> From: ncl-talk-bounces_at_ucar.edu [mailto:ncl-talk-bounces_at_ucar.edu] On
> Behalf Of Harun Rashid
> Sent: Monday, April 21, 2008 7:06 PM
> To: ncl-talk_at_ucar.edu
> Cc: Harun Rashid
> Subject: Truncation of tmXBLabels [SEC=UNCLASSIFIED]
>
>
>
> Hi,
>
>
>
> I would like to truncate the xlabel values in a histogram plot
> (attached) to one or two significant digits. I can do this using
> tmXBValues <mailto:resH_at_tmXBValues> and tmXBLabels
> <mailto:resH_at_tmXBLabels> resources, but things become a bit messy. I've
> also tried a few of the HLU formatting strings (with which I am not very
> familiar) with tmXBFormat resource, but failed (tickmarks are labelled
> with positive values only). Does anyone have a quick solution to this
> problem. Thanks.
>
>
>
> Cheers,
>
> Harun
>
>
>
>
>
> ===================================================================
> Dr. M. Harun Ar Rashid
> Centre for Australian Weather and Climate Research Email:
> h.rashid_at_bom.gov.au
> PO Box 1289K
> Tel : +61 3 9669 4550
> Melbourne, Victoria 3001
> Fax : +61 3 9669 4660
> Australia
> http://www.bom.gov.au/bmrc
> ===================================================================
>
>
>
>
>

_______________________________________________
ncl-talk mailing list
ncl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk

Received on Tue Apr 22 2008 - 08:59:36 MDT

This archive was generated by hypermail 2.2.0 : Tue Apr 22 2008 - 09:55:07 MDT