#20 XYPlot with equal axes


I came across the need to have equal axes in my plots.
I modified XYPlot in a few places to accomplish this.

- a private boolean to keep track of whether equal axes
are desired
- an "extension" to getDataRange which centers the
range around the center of the original data and has a
range equal to the largest range of all of the data
- a new function call in draw
- the new function, being called from draw, that takes
the given data area and "squares it off"

I would describe this as being around 80% completed. I
am not sure of all the repurcusions that this may
involve (for example, does this deal well data that
uses its own secondary axes? On the other hand, if
secondary axes are being used then would you use equal
axes on the same plot? Should some sort of error
message be displayed if this is attempted? If so, when?)

Furthermore, the equal axes behavior is not perfect.
Two notable exceptions are when the plot is re-shaped
to be "small" (less than approximately 300 x 300
pixels) or "very large" (more than approximately 900 x
900 pixels). At this point, the grid is no longer
square on the physical screen. I suspect that this has
something to do with either:
- the AxisSpace and that it tries to stretch or expand
the text to accomodate these "extreme" dimensions
- some minimum or maximum size restrictions affiliated
with the graphs


  • David Gilbert

    David Gilbert - 2004-01-29
    • assigned_to: nobody --> mungady
  • David Gilbert

    David Gilbert - 2004-01-29

    Logged In: YES

    Hi Michel,

    Thanks for the patch. I'll let you know when I've had a
    chance to look at the code.


    Dave Gilbert
    JFreeChart Project Leader

  • David Gilbert

    David Gilbert - 2004-01-29
    • priority: 5 --> 6
  • Michel

    Michel - 2005-01-31

    Logged In: YES


    I have updated the file to reflect the latest version of
    XYPlot from 0.9.21

    The changes are all below line 3286.


  • Michel

    Michel - 2005-02-02

    Logged In: YES

    My prior message failed to upload the updated file.

  • Michel

    Michel - 2005-02-02

    Updated XYPlot.java


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

Sign up for the SourceForge newsletter:

No, thanks