[ncl-talk] tmYLFormat deleting trailing zero for a panel plot

Lijun Diao ljdiao at gmail.com
Sun Jun 19 22:52:40 MDT 2016


Hi, Mary:

That is exactly what I did. But for another array as (/0,0.7,1.4, 2.1,2,8/). I set “@f” and then the labels appear as I want automatically. The only difference between the two arrays is that the maximum value for the first array (/0.0, 0.2,0.4,0.6,0.8/) is less than 1, while the other larger than 1. 

thanks,

From: Mary Haley 
Sent: Sunday, June 19, 2016 11:07 PM
To: Lijun Diao 
Cc: ncl-talk 
Subject: Re: [ncl-talk] tmYLFormat deleting trailing zero for a panel plot

My apologies, I misunderstood that you wanted to take off the ".0" for the "0.0" label.

I don't think you can mix and match tickmark formatting simply by setting tmXBLabelFormat.  If you explicitly want "0" for "0.0", but "0.7" for ".7" then you will need to do something like this:

xaxis_values = (/0,0.2,0.4,0.6,0.8/) 
xaxis_labels = sprintf("%2.1f",xaxis_values)
xaxis_labels(0) = "0"    ; explictly change the first label


res at tmXBMode = "Explicit"
res at tmXBValues = xaxis_values
res at tmXBLabels = xaxis_labels


--Mary




On Fri, Jun 17, 2016 at 8:53 AM, Lijun Diao <ljdiao at gmail.com> wrote:

  Hi, Mary: 

  As the example shows, 0f still has 0.0 not 0 as I wanted. I already set the labels explicitly. I just wonder why for one array, it appears 0.0 while for the other 0. 

  thanks,

  On Fri, Jun 17, 2016 at 9:15 AM, Mary Haley <haley at ucar.edu> wrote:

    This is not a panel plot issue per se.  When you create the individual plots is when you need to fix the labels the way you want them. 

    Did you see example tm_8.ncl at:

    http://www.ncl.ucar.edu/Applications/tickmarks.shtml#ex8


    This shows the different formats you can use.  I would try "0f".

    --Mary



    On Wed, Jun 15, 2016 at 11:13 PM, Lijun Diao <ljdiao at gmail.com> wrote:

      Hi, all:

      I have a panel plot and try to set the number format of the y-axes . I attached two axes from two subplots. For the left one, minimum value zero is outputed as “0.0”, while for the right one “0”. I set them use the same tmYLFormat = "@f". So my question is how can I set the starting number of the first axis also to be “0”. By the way, I need “0.7” not “.7”

      thanks,


      -----------------------------------------------------------------------------
      Lijun Diao
      ldiao at uh.edu
      Research Assistant
      Department of Earth & Atmospheric Sciences
      University of Houston
      4800 Calhoun RD., Bldg. S&R1-312
      Houston, TX 77204-5007

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




-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20160619/bed6a3d9/attachment.html 


More information about the ncl-talk mailing list