Menu

#145 Fix Y axis default for horizontal plots

closed
lbayuk
None
4
2012-09-07
2010-09-23
lbayuk
No

Currently, the X axis default is Y=0 (or min(abs(Y)) if Y=0 is not in the plot), and the Y axis default is on the left side (min(x)). This was not changed when horizontal plots were introduced, but it probably should have been. With a horizontal bar plot or thinbarline plot with negative values, the bars go in the wrong direction by default, unless SetYAxisPosition(0) is used. With upcoming support for negative values in stackebarplots, the negative stacks are not being plotted at all (because they would go in the wrong direction), unless the Y axis is moved to 0.

Make the X and Y axis default position calculations symmetrical, so that in vertical plots X and Y act like Y and X respectively in horizontal plots.

Related

Wiki: SampleYAxisDefaultChange

Discussion

  • lbayuk

    lbayuk - 2010-09-24

    Change internal function CalcAxisPositions() so it will calculate axis position defaults consistently. For vertical plots, there is no change. For horizontal plots, the X axis position defaults to the bottom, and the Y axis position defaults to zero (if visible), else the left or right of the plot (whichever is closer to zero). This fixes the odd bar or line directions in horizontal plots with negative values.

    Vertical plots should not change at all. Horizontal plots will look different if they have negative values and the Y axis position is allowed to default. There are pictures here:
    http://phplot.sourceforge.net/samples/yaxis_default_change.php

     
  • lbayuk

    lbayuk - 2010-09-24

    The change described in the previous comment has been committed to CVS and will be in the next release.

     
  • lbayuk

    lbayuk - 2010-10-04

    Fixed in PHPlot-5.2.0

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.