Michael Jay
Michael Jay

Reputation: 49

Core Plot: number of major x intervals

Using core plot framework I have an XYScatter Plot. Everything works fin, but my x-axis has 3 major tick marks. Full scale is 10 so this is making my major ticks come out on the 1/3. Very strange. I have tried different combinations of:

CPTXYAxisSet *axisSet               = (CPTXYAxisSet *)plot.axisSet;
CPTXYAxis *x                        = axisSet.xAxis;

x.preferredNumberOfMajorTicks       = 4;
x.majorIntervalLength               = [[NSNumber numberWithFloat:35.0] decimalValue];
x.labelingPolicy                    = CPTAxisLabelingPolicyAutomatic;

... but can not seem to get what I would like - a plot that has major ticks divisible by 2 or or 5.

Upvotes: 1

Views: 1234

Answers (1)

Eric Skroch
Eric Skroch

Reputation: 27381

Try leaving preferredNumberOfMajorTicks at the default of zero (0). If the plot range has length 10, this should give you ticks every two units apart. The majorIntervalLength property has no effect on the automatic labeling policy.

Upvotes: 1

Related Questions