title: Androidplot - background and ranges
body: <p>I'm new to that library. I'm trying to Create the following plot:</p>
  
  <p><img src="https://i.stack.imgur.com/Dx95k.png" alt="enter image description here"></p>
  
  <p>Meanwhile I have the next one:</p>
  
  <p><img src="https://i.stack.imgur.com/0DQgy.png" alt="enter image description here"></p>
  
  <p><strong><em>My questions:</em></strong>   NOTE: The colors doesn't matters</p>
  
  <ol>
  <li><p>How do I get rid of the black area (where was lables on range domain and title)
  and center the plot (like in the first picture)</p></li>
  <li><p>How to add ranges as in the first picture ?  (x:[1-7] y:[0-4500])</p></li>
  <li><p>Make the same grid as in the first picture</p></li>
  </ol>
  
  <p><strong>My code:</strong></p>
  
  <pre><code>public class MainActivity extends Activity {
  
  private XYPlot mySimpleXYPlot;
  
  @Override
  public void onCreate(Bundle savedInstanceState)
  {
  
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
  
   // Create a couple arrays of y-values to plot:
      Number[] days =   { 1  , 2   , 3   , 4   , 5   , 6   , 7 };
      Number[] values = { 380, 1433, 1965, 3200, 3651, 3215, 3217 };
  
      // initialize our XYPlot reference:
      mySimpleXYPlot = (XYPlot) findViewById(R.id.mySimpleXYPlot);
      mySimpleXYPlot.getBackgroundPaint().setColor(Color.WHITE);
      mySimpleXYPlot.setBorderStyle(XYPlot.BorderStyle.NONE, null, null);
      mySimpleXYPlot.getGraphWidget().getBackgroundPaint().setColor(Color.WHITE);
      mySimpleXYPlot.getGraphWidget().getGridBackgroundPaint().setColor(Color.WHITE);
  
  
  
      // Domain
      mySimpleXYPlot.getGraphWidget().setDomainLabelPaint(null);
      mySimpleXYPlot.getGraphWidget().setDomainOriginLinePaint(null);
      mySimpleXYPlot.setDomainStep(XYStepMode.INCREMENT_BY_VAL, days.length);     
      mySimpleXYPlot.setDomainValueFormat(new DecimalFormat("0"));
  
  
      //Range
      mySimpleXYPlot.getGraphWidget().setRangeOriginLinePaint(null);
      mySimpleXYPlot.setRangeStep(XYStepMode.SUBDIVIDE, values.length);
      mySimpleXYPlot.setRangeValueFormat(new DecimalFormat("0"));
  
  
      //Remove legend
      mySimpleXYPlot.getLayoutManager().remove(mySimpleXYPlot.getLegendWidget());
      mySimpleXYPlot.getLayoutManager().remove(mySimpleXYPlot.getDomainLabelWidget());
      mySimpleXYPlot.getLayoutManager().remove(mySimpleXYPlot.getRangeLabelWidget());
      mySimpleXYPlot.getLayoutManager().remove(mySimpleXYPlot.getTitleWidget());
  
      // Turn the above arrays into XYSeries':
      XYSeries series1 = new SimpleXYSeries(
              Arrays.asList(days),          
              Arrays.asList(values), 
              "Series1");                             // Set the display title of the series
  
      // Create a formatter to use for drawing a series using LineAndPointRenderer:
      LineAndPointFormatter series1Format = new LineAndPointFormatter(
              Color.rgb(0, 200, 0),                   // line color
              Color.rgb(0, 100, 0),                   // point color
              Color.CYAN);                            // fill color 
  
   // setup our line fill paint to be a slightly transparent gradient:
      Paint lineFill = new Paint();
      lineFill.setAlpha(200);
      lineFill.setShader(new LinearGradient(0, 0, 0, 250, Color.WHITE, Color.GREEN, Shader.TileMode.MIRROR));
  
      series1Format.setFillPaint(lineFill);
  
      // add a new series' to the xyplot:
      mySimpleXYPlot.addSeries(series1, series1Format);
  
      // by default, AndroidPlot displays developer guides to aid in laying out your plot.
      // To get rid of them call disableAllMarkup():
      mySimpleXYPlot.disableAllMarkup();
  }
  
  }
  </code></pre>