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
- 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