使用核心绘图框架,我有一个 XYScatter Plot
。一切正常,但我的 x 轴有 3 个主要刻度线。满刻度是 10,所以这让我的主要滴答声出现在 1/3。很奇怪。我尝试了不同的组合:
CPTXYAxisSet *axisSet = (CPTXYAxisSet *)plot.axisSet;
CPTXYAxis *x = axisSet.xAxis;
x.preferredNumberOfMajorTicks = 4;
x.majorIntervalLength = [[NSNumber numberWithFloat:35.0] decimalValue];
x.labelingPolicy = CPTAxisLabelingPolicyAutomatic;
...但似乎无法得到我想要的 - 一个主要刻度可被 2 或 5 整除的情节。
最佳答案
尝试将 preferredNumberOfMajorTicks
保留为默认值零 (0)。如果绘图范围的长度为 10,则这应该为您提供每两个单位间隔的刻度。 majorIntervalLength
属性对自动标记策略没有影响。
关于objective-c - 核心剧情: number of major x intervals,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13103247/