Re: labels on label bar.

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Fri, 20 Jun 2008 20:22:28 -0600 (MDT)

Kolya,

Dave Brown was able to track this bug down and fix it. Meanwhile,
he suggested working around this by setting:

     resources.cnMaxDataValueFormat = ".4f"

The reason why the labels were getting weird had to do with the
actual minimum of your data being 1000 times less than the
minimum contour level.

In Dave's words, regarding the fix:

...because the calculation of the leftmost significant digit is based on the
    data minimum value rather than the minimum level value, most of the
    significant digits get lost in the second plot. I think the solution
    is to base the calculation of the leftmost significant digit on
    min(max(fabs(min_level_value), fabs(max_level_value)),
    max(fabs(min_data_value), fabs(max_data_value))). This will ensure
    that there is always enough precision to create proper labels.

Let me know if the above work-around doesn't work for you.

--Mary

On Thu, 19 Jun 2008, Mary Haley wrote:

>
> Kolya,
>
> An update: after running your script (thanks for providing the files),
> it appears that the labelbars are slightly changing size for some
> plots. This causes the labels themselves to change, because there's
> an internal algorithm that tries to determine the best placement and
> size of the labels, depending on the size of the labelbar.
>
> This seems a bit questionable to me, because I don't see why the
> labelbar should be changing size, given that your plots appear
> to be the same size in each frame.
>
> I'll continue to look into this.
>
> --Mary
>
> On Tue, 17 Jun 2008, Mary Haley wrote:
>
>> Hi Kolya,
>>
>> I was unable to reproduce the problem using dummy data. Please
>> see the attached python script where I used dummy data, and
>> pretty much the same resources as you did.
>>
>> Can you let me know if your version of PyNGL still has the
>> bad labels with this script?
>>
>> --Mary
>>
>>
>>
>> On Tue, 17 Jun 2008, Nikolay Koldunov wrote:
>>
>>> Dear all,
>>
>> I have a problem with labels on label bar.
>>
>> I specify cnLevels as (-150,150,2), but have labels in zeros
>> multiplied by 10 raised to the power of 7.
>>
>> Can anyone help me to get normal values?
>>
>> My script, and example of the output are in attachment.
>>
>> Thank you in advance :)
>>
>> Kolya
>>
>>
>> --
>> Nikolay Koldunov
>> International Max Planck Research School on Earth System Modelling,
>> Institut für Meereskunde der Universität Hamburg,
>> Zentrum für Meeres- und Klimaforschung
>>
>> koldunovn_at_gmail.com
>> nikolay.koldunov_at_zmaw.de
>> ph. +49 40 428385430
>> Bundesstr. 53, room 146,
>> 20146 Hamburg, Germany

_______________________________________________
pyngl-talk mailing list
pyngl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/pyngl-talk
Received on Fri Jun 20 2008 - 20:22:28 MDT

This archive was generated by hypermail 2.2.0 : Thu Jun 26 2008 - 16:30:24 MDT