#442 NumberAxis won't display labels for numbers > 1E13

General (896)

When trying to plot a timeseries with large y-values,
the labels disappear when the scale goes beyond 1E12.
Actually it gets very wierd for numbers in the 1E13
range, and then disappears if the values are scaled up
to the 1E14 range. The calling code looks like:

final DateAxis xAxis = (DateAxis) plot.getDomainAxis();
dateForm.setTimeZone( TimeZone.getTimeZone( "GMT" ) );
xAxis.setDateFormatOverride( dateForm );
xAxis.setLabelFont(new Font("Monospaced", Font.PLAIN, 1) );
xAxis.setLabel( xLabel );

final NumberAxis yAxis = (NumberAxis) plot.getRangeAxis();
DecimalFormat form = new DecimalFormat("0.#E0#");
yAxis.setNumberFormatOverride( form );
yAxis.setLabel( yLabel );

The relevant application is available for download from:

The source is also available. To see the bug, download
and launch. Choose File/Load Local and select the file


  • David Gilbert

    David Gilbert - 2006-08-18
    • labels: --> General
    • assigned_to: nobody --> mungady
    • status: open --> closed
  • David Gilbert

    David Gilbert - 2006-08-18

    Logged In: YES

    I realise this is an old bug report but...

    This is caused by the default TickUnitSource used by the
    NumberAxis class (the default is a collection returned by
    NumberAxis.createStandardTickUnits()) only supporting a
    certain range of values. To resolve this, you can either:

    (1) Supply your own custom collection with tick units of
    the appropriate size; or

    (2) Call setStandardTickUnits(new StandardTickUnitSource())
    on the axis.


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks