Hi,
I updated Iolite from v4.5 to 4.7 and I have few issues with my plugins. It has to do with the changes in the API for QCPAxis.
So far these two commands return an error
plot.left().setRange((Ymin,Ymax))
and
plot.left().setLabel('Test')
How should I change them?

All the best

Nathan

Ok, I found the answer for the label one:
plot.left().label='Test'
But still don't get what has changed for the setRange one

All the best

Nathan

  • Joe replied to this.

    Nathan

    You can now change the range as below:

    from iolite.ui import QCPRange
    
    # A bunch of code to create a plot...
    
    plot.left().range = QCPRange(Ymin, Ymax)

    All the best,

    • Joe
    11 days later

    Hi,

    I see the labeling on the y-axis always in scientific, i.e 1x101, and can't see the actual number. how do i change the format?
    edit: Just figured that this was because i had accidentally clicked the '10n' button in the tools. When you click it again it doesn't revert back to the original number format. That's a bug.

    I also saw that Bence posted this updated syntax for the UPb example:
    plot.left().label = ratio['name']
    This doesn't work for me, I have to remove the ratio[] don't know why.
    Some of the older DRS examples are not updated to the new api and the plots won't work.

    thx, kai

    • Joe replied to this.

      kai2

      Thanks for pointing this out. It was changing the number format back, but not the number precision. It is now fixed. FYI, you can change the number format as below (for example):

      plot.left().numberFormat = 'gbc'

      Where the format string is as documented for QCPAxis:

      formatCode is a string of one, two or three characters.

      The first character is identical to the normal format code used by Qt. In short, this means: 'e'/'E' scientific format, 'f' fixed format, 'g'/'G' scientific or fixed, whichever is shorter. For the 'e', 'E', and 'f' formats, the precision set by setNumberPrecision represents the number of digits after the decimal point. For the 'g' and 'G' formats, the precision represents the maximum number of significant digits, trailing zeroes are omitted.

      The second and third characters are optional and specific to QCustomPlot:
      If the first char was 'e' or 'g', numbers are/might be displayed in the scientific format, e.g. "5.5e9", which is ugly in a plot. So when the second char of formatCode is set to 'b' (for "beautiful"), those exponential numbers are formatted in a more natural way, i.e. "5.5 [multiplication sign] 10 [superscript] 9". By default, the multiplication sign is a centered dot. If instead a cross should be shown (as is usual in the USA), the third char of formatCode can be set to 'c'. The inserted multiplication signs are the UTF-8 characters 215 (0xD7) for the cross and 183 (0xB7) for the dot.

      I've updated the other example data reduction schemes to reflect the API change. However, I have no problem with the U-Pb example, so it isn't clear why it does not work for you. Have you modified it? Is there any error written to the python console?

      All the best,

      • Joe