[ncl-talk] "Padding" Y axis tickmark labels to match w/ different number of digits
Colin Zarzycki
zarzycki at umich.edu
Tue Jun 23 17:17:06 MDT 2015
Hi all,
It appears (knock on wood) that I have solved this problem -- the trick was
properly formatting the label strings with spaces as the padding
characters, then forcing NCL to have constant spacing between the digits
such that each tickmark label is the same horizontal length, regardless of
the size of the numeric string.
res at tmYLFormat="& 5;*f"
res at tmYLLabelConstantSpacingF=0.95
Cheers,
-Colin
On Tue, Jun 23, 2015 at 3:24 PM, Colin Zarzycki <zarzycki at umich.edu> wrote:
> Hi all,
>
> I am creating a 4x4 tile of XY plots generated in NCL for use in a LaTeX
> figure (technically, a table inside a figure).
>
> I require the figures to be of identical size. However, the fact that the
> Y-axis labels have different numbers of maximum digits between the two
> panels seems to be problematic in getting the figures to match in size.
>
> I have attached two figures that highlight this problem. If I just leave
> NCL to generate the tickmarks as default, I get the figure where the XY
> boxes differ in size (when scaled to fit in the 4x4 table). This appears to
> occur because, for example, the Y axis in panel (a) has 2 digits while the
> Y axis in panel (c) has 4 digits.
>
> If I manually override NCL's defaults such that the Y tickmark labels have
> matching a precision of 4 (set tiYAxisOffsetXF to False), the problem is
> (mostly) alleviated. However, this creates the problem of having extraneous
> decimal points instead of integer values in the labels.
>
> Is there a way I can essentially "pad" the Y-axis label such that they
> take up the same size regardless of how many digits NCL actually prints? I
> have tried tiYAxisOffsetXF to try and force the white space to be
> controlled by the Y axis title, but apparently the NDC coordinates scale
> with number of Y-axis tickmark digits as well, so it doesn't solve the
> problem.
>
> Cheers,
>
> -Colin
>
> --
> Colin M. Zarzycki, ASP postdoctoral fellow
> Atmospheric Modeling and Predictability
> National Center for Atmospheric Research
> http://www.colinzarzycki.com
>
--
Colin M. Zarzycki, ASP postdoctoral fellow
Atmospheric Modeling and Predictability
National Center for Atmospheric Research
http://www.colinzarzycki.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20150623/860b45b7/attachment.html
More information about the ncl-talk
mailing list