Menu

#101 Fix automatic Y range calculations

6.0.0
closed
lbayuk
None
5
Fixed
2013-04-03
2007-09-17
lbayuk
No

This report documents a known problem with PHPlot.

When PHPlot automatically calculates the Y data ranges (without SetPlotAreaWorld settings), it does not always do a good job. A more rigorous, mathematically correct method is needed, after defining exactly what it is we are trying to do here. It needs to work on all possible ranges of data.

References:
Bug # 1182666 "Y auto-scale rounds in wrong direction" patched the calculation, but pointed out that the method was still flawed.

Bug # 1731268 pointed out a problem with the change. But the fix therein was not usable.

Related

Wiki: 6.0.0-NEWS

Discussion

  • lbayuk

    lbayuk - 2009-06-10

    A new method is being developed. It starts with a smarter way to calculate a tick interval, then adjusts the range based on the tick interval. The results look good so far. It calculates a much more reasonable range and tick interval. There is more work needed, and there will be some incompatibilities with the current PHPlot, so it will most likely be introduced in a middle or major version (5.1.0 or 6.0.0).

     
  • lbayuk

    lbayuk - 2012-04-25

    This effort has been restarted. The scope now includes both X and Y ranges.

    Automatic range calculation occurs only for values not given with SetPlotAreaWorld(). That is, if Xmax and Ymin are set with that function, PHPlot will use the range calculation algorithm to set Xmin and Ymax.

    There will be the ability to "tune" the automatic algorithm, including: adjusting a "zero affinity" factor which determines how much PHPlot will extend a data range to include zero.

    This work is tied in with bug #2919086 "Improve tick interval calculations", and the target is to have both fixed in PHPlot-6.0.

     
  • lbayuk

    lbayuk - 2012-06-07

    This is progressing well. Developement in SVN is at /branches/Rel6.

    The development branch passes all 800 tests in the test suite, with 412 producing different images. (Which is better than the 498 before recent changes.) Nearly all the differing images are improved with this release.

    There are still issues with tick anchors, and with date/time ranges.

     
  • lbayuk

    lbayuk - 2012-09-08
    • milestone: --> 6.0.0
     
  • Yaakov

    Yaakov - 2012-10-26

    Is this going to help X Axis Ticks/Grids as well? I hope it does! However, months don't have a fixed number of days, but it would be nice to see May 1, June 1, July 1, etc., instead of May 1, May 30, June 30.

     
  • lbayuk

    lbayuk - 2012-10-28

    Yaakov: This bug report is for the calculated range on Y (and X too). There is a different one [bugs:#132] on tick interval calculations. Currently, however, all the tick marks must be uniformly spaced, so it isn't possible to make a tick mark on the first of each month when plotting daily data. It's a good idea though, and something I need to think about.

     

    Related

    Bugs: #132

  • lbayuk

    lbayuk - 2013-03-28

    This will be fixed in PHPlot-6.0.0. There is a new method for automatically calculating the X and Y axis ranges when SetPlotAreaWorld() is not used (or, calculating one end of the range if SetPlotAreaWorld sets the other). This is a multi-step process, and includes conditionally stretching the range to include 0, adjusting the ends to make space, and making sure (by default) the range starts and ends at a tick mark.

    There are new functions to 'tune' the automatic range calculations, for example to adjust how far PHPlot will stretch the range to include 0.

    Documentation has been updated, including a new section that describes how PHPlot calculates the range, and reference documentation for the 2 new tuning functions.

     
  • lbayuk

    lbayuk - 2013-03-28
    • resolution: --> Fixed
     
  • lbayuk

    lbayuk - 2013-04-03
    • status: open --> closed
     
  • lbayuk

    lbayuk - 2013-04-03

    Fixed in 6.0.0

     

Log in to post a comment.