@Override public AxisSpace reserveSpace(Graphics2D g2,Plot plot,Rectangle2D plotArea,RectangleEdge edge,AxisSpace space){
  if (space == null) {
    space=new AxisSpace();
  }
  if (!isVisible()) {
    return space;
  }
  double dimension=getFixedDimension();
  if (dimension > 0.0) {
    space.add(dimension,edge);
    return space;
  }
  double tickLabelHeight=0.0;
  double tickLabelWidth=0.0;
  if (isTickLabelsVisible()) {
    g2.setFont(getTickLabelFont());
    List ticks=refreshTicks(g2,new AxisState(),plotArea,edge);
    if (RectangleEdge.isTopOrBottom(edge)) {
      tickLabelHeight=findMaximumTickLabelHeight(ticks,g2,plotArea,isVerticalTickLabels());
    }
 else     if (RectangleEdge.isLeftOrRight(edge)) {
      tickLabelWidth=findMaximumTickLabelWidth(ticks,g2,plotArea,isVerticalTickLabels());
    }
  }
  Rectangle2D labelEnclosure=getLabelEnclosure(g2,edge);
  if (RectangleEdge.isTopOrBottom(edge)) {
    double labelHeight=labelEnclosure.getHeight();
    space.add(labelHeight + tickLabelHeight,edge);
  }
 else   if (RectangleEdge.isLeftOrRight(edge)) {
    double labelWidth=labelEnclosure.getWidth();
    space.add(labelWidth + tickLabelWidth,edge);
  }
  return space;
}

@ Override public AxisSpace reserveSpace ( Graphics2D g2 , Plot plot , Rectangle2D plotArea , RectangleEdge edge , AxisSpace space ) { if ( space == null ) { space = new AxisSpace ( ) ; } if ( ! isVisible ( ) ) { return space ; } double dimension = getFixedDimension ( ) ; if ( dimension > 0.0 ) { space . add ( dimension , edge ) ; return space ; } double tickLabelHeight = 0.0 ; double tickLabelWidth = 0.0 ; if ( isTickLabelsVisible ( ) ) { g2 . setFont ( getTickLabelFont ( ) ) ; List ticks = refreshTicks ( g2 , new AxisState ( ) , plotArea , edge ) ; if ( RectangleEdge . isTopOrBottom ( edge ) ) { tickLabelHeight = findMaximumTickLabelHeight ( ticks , g2 , plotArea , isVerticalTickLabels ( ) ) ; } else if ( RectangleEdge . isLeftOrRight ( edge ) ) { tickLabelWidth = findMaximumTickLabelWidth ( ticks , g2 , plotArea , isVerticalTickLabels ( ) ) ; } } Rectangle2D labelEnclosure = getLabelEnclosure ( g2 , edge ) ; if ( RectangleEdge . isTopOrBottom ( edge ) ) { double labelHeight = labelEnclosure . getHeight ( ) ; space . add ( labelHeight + tickLabelHeight , edge ) ; } else if ( RectangleEdge . isLeftOrRight ( edge ) ) { double labelWidth = labelEnclosure . getWidth ( ) ; space . add ( labelWidth + tickLabelWidth , edge ) ; } return space ; }
returns the space required to draw the axis .
