boyfarrell.com

4 September 2007

ChocPlot: Mutable Axis Model

The original AxisModel was quite limited in it’s abilities; it just did everything automatically. Here I introduce the mutable subclass of AxisModel; MutableAxisModel

As this is a subclass it still responds to the same methods defined in AxisModel; -interval, -spacing, -start, -stop, -representation, -description

MutableAxisModel adds additional methods designed to give the user some control over the axis properties. These new methods are: -setStart:, -setStop:, -moreIntervals, -fewerIntervals

As one might expect these allow the start and stop to be set exactly; these values will not be rounded like the -initWithStart:stop: values are with AxisModel. The interval positions are still placed at nice rounded intervals but inside these end-points. Using the last two methods in the list allows the number of axis interval (tic marks) can be increased or decreased.

The actual number of intervals afterwards is determined by MutableAxisModel, if it thinks that you have too many (such that adding more would just looked cluttered), it won’t add anymore! The same is true for the opposite case; having to fewer intervals.

There are a few more model classes left before moving on to the Graphical objects. The next post will be about LinkedAxisModel; a subclass of mutable axis model that uses a transform to display the same data but it different units.

Source Code with Documentation (104kB)

One Comment currently posted.

boyfarrell.com » ChocPlot: First Results says:

[...] Also, we will implement the code from the first few chocplot plots and have nicley spaced axis labels on the plot. [...]

Post a comment on this entry: