title: Core Plot: Tick Intervals
body: <p>I'm using Core Plot in an iOS-Application and want to format the steps of axis. All I get is steps of 0.5 and I don't know what else to change. My tick Locations should by 5, 10, 15 and  20.</p>
  
  <p>Here is the code that draws my axis:</p>
  
  <pre><code>-(void) addAxis{
  
      // Create grid line styles
      CPTMutableLineStyle *majorGridLineStyle = [CPTMutableLineStyle lineStyle];
      majorGridLineStyle.lineWidth = 1.0f;
      majorGridLineStyle.lineColor = [[CPTColor whiteColor] colorWithAlphaComponent:0.75];
  
      NSSet *majorTickLocations = [NSSet setWithObjects:[NSDecimalNumber zero],
                                   [NSDecimalNumber numberWithUnsignedInteger:5],
                                   [NSDecimalNumber numberWithUnsignedInteger:10],
                                   [NSDecimalNumber numberWithUnsignedInteger:15],
                                   [NSDecimalNumber numberWithUnsignedInteger:20],
                                   nil];
  
      // Create axes
      CPTXYAxisSet *axisSet = (CPTXYAxisSet *)self.graph.axisSet;
      CPTXYAxis *x = axisSet.xAxis;
      {
          x.labelingPolicy = CPTAxisLabelingPolicyLocationsProvided;
          x.tickDirection = CPTSignNone;
          x.majorTickLocations = majorTickLocations;
          x.labelOffset = 6.0;
          x.labelRotation = M_PI/2;
          x.visibleRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromFloat(0.0f) length:CPTDecimalFromFloat(19.0f)];
          x.gridLinesRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromFloat(0.0f) length:CPTDecimalFromFloat(30.0f)];
          x.title = @"Jahre";
          x.titleOffset = 35.0f;
          x.titleLocation = CPTDecimalFromFloat(x.visibleRange.lengthDouble / 2.0);
          x.plotSpace = self.barPlotSpace;
      }
  
      CPTXYAxis *y = axisSet.yAxis;
      {
          y.labelingPolicy = CPTAxisLabelingPolicyLocationsProvided;
          y.majorTickLocations = majorTickLocations;
          y.minorTicksPerInterval = 0;
          y.preferredNumberOfMajorTicks = 8;
          y.majorGridLineStyle = majorGridLineStyle;
          y.axisLineStyle = nil;
          y.majorTickLineStyle = nil;
          y.minorTickLineStyle = nil;
          y.labelOffset = 10.0;
          y.visibleRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromFloat(0.0f) length:CPTDecimalFromFloat(30.0f)];
          y.gridLinesRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromFloat(0.0f) length:CPTDecimalFromFloat(18.5f)];
          y.title = @"Sparbetrag";
          y.titleOffset = 40.0f;
          y.titleLocation = CPTDecimalFromFloat(y.visibleRange.lengthDouble / 2.0);
          y.plotSpace = barPlotSpace;
      }
  
      // Set axes
      self.graph.axisSet.axes = [NSArray arrayWithObjects:x, y, nil];
  }
  </code></pre>