gpt4 book ai didi

ios - 核心情节 : y Axis labels should start from 60

转载 作者:行者123 更新时间:2023-11-29 10:55:01 25 4
gpt4 key购买 nike

我需要绘制一个散点图,其中 x 轴应与 y 轴相交于 (0,60)。我还需要 y 轴上的间隔为 20。

我现在面临的问题是:

  1. y轴从0开始
  2. 例如 60 - 80 之间的 y 轴标签间距太大。

到目前为止我做了什么:

设置交点:

x.orthogonalCoordinateDecimal = CPTDecimalFromString(@"60");

设置主要刻度位置:

NSSet *majorTickLocations = [NSSet setWithObjects:[NSDecimalNumber zero],
[NSDecimalNumber numberWithUnsignedInteger:60],
[NSDecimalNumber numberWithUnsignedInteger:80],
[NSDecimalNumber numberWithUnsignedInteger:100],
[NSDecimalNumber numberWithUnsignedInteger:120],
nil];

y.majorTickLocations = majorTickLocations;

方向上的任何指针都会有所帮助。

问候,伊山

最佳答案

要使轴在 (0, 60) 处相交,请设置每个轴的 orthogonalCoordinateDecimal:

x.orthogonalCoordinateDecimal = CPTDecimalFromDouble(60.0);
y.orthogonalCoordinateDecimal = CPTDecimalFromDouble(0.0);

轴标签政策决定了刻度线和标签的定位方式。如果您自己提供刻度和标签位置 (CPTAxisLabelingPolicyNone),您可以将它们放在任何您想要的位置。有关每个可用标签策略的示例,请参阅 Plot Gallery 示例应用中的“轴标签策略”演示。

关于ios - 核心情节 : y Axis labels should start from 60,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18785449/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com