title: iPhone CorePlot proper formatting of y-axis
body: <p>I am using CorePlot to graph a set of data. Data for my x-axis consists of dates, while data for my y-axis consists of floats (which I then turn into NSNumber). I am getting data from a feed, and the feed returns numbers with a large number of decimals, eg: 0.46673718852844, 4.59392222219, 353.1293012045.
  I'm using the following piece of code to properly format y-axis:</p>
  
  <pre><code>NSNumberFormatter *numberFormatter = [[[NSNumberFormatter alloc] init] autorelease];
  [numberFormatter setNumberStyle:NSNumberFormatterDecimalStyle];
  [numberFormatter setMaximumFractionDigits:3];
  [numberFormatter setPositiveFormat:@"###0.000"];    
  CPTXYAxis *y = axisSet.yAxis;
  y.labelingPolicy = CPTAxisLabelingPolicyAutomatic;
  y.minorTicksPerInterval = 1;
  y.preferredNumberOfMajorTicks = 5;
  y.labelFormatter = numberFormatter;
  </code></pre>
  
  <p>In most cases, everything works fine. However, sometimes it displays the same value at multiple positions along the axis. See image below:    </p>
  
  <p><img src="https://i.stack.imgur.com/uu0MS.png" alt="enter image description here"></p>
  
  <p>The values are presented correctly, I would just like to avoid unnecessary (0.466) labels. I've even tried to round the numbers to 3 decimals in <code>numberForPlot</code> method:</p>
  
  <pre><code>if(fieldEnum == CPTScatterPlotFieldY)
  { 
          float floatNum = r.value;
          floatNum *= 1000;
          int intValue = (int) floatNum;
          float decimal = floatNum - intValue;
          if (decimal &gt; 0.5) {
              intValue++;
          }
          floatNum = intValue /1000.0;
          return [NSNumber numberWithFloat:floatNum];
  
  }
  </code></pre>
  
  <p>but there is no difference in labels.</p>