Intervalos de ticks: cambiándolo desde el valor predeterminado

So I am trying to change the tick intervals of the x and y axis. But the default is counting up by .5. I want to change it to count up by tens. Please help. I have recently tried something like this but had no luck.

xMajorInterval = 10;
yMajorInterval = 10;  
axisSet.xAxis.majorIntervalLength = CPTDecimalFromFloat(xMajorInterval);
axisSet.xAxis.minorTicksPerInterval = 4;
axisSet.xAxis.minorTickLength = 4.0f;
axisSet.xAxis.majorTickLength = 8.0f;
axisSet.xAxis.labelOffset = 1.0f;

axisSet.yAxis.majorIntervalLength = CPTDecimalFromFloat(yMajorInterval);
axisSet.yAxis.minorTicksPerInterval = 4;
axisSet.yAxis.minorTickLength = 4.0f;
axisSet.yAxis.majorTickLength = 8.0f;
axisSet.yAxis.labelOffset = 1.0f;    

preguntado el 31 de julio de 12 a las 15:07

Which labeling policy do your axes use? The default is CPTAxisLabelingPolicyFixedInterval which should be fine with the code you posted. -

0 Respuestas

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.