code: public PlotCanvas setMargin(double margin) {
          if (margin < 0.0 || margin >= 0.3) {
              throw new IllegalArgumentException("Invalid margin: " + margin);
          }
          
          this.margin = margin;
          repaint();
          return this;
      }
docs: Sets the size of margin in [0.0, 0.3] on each side. Currently, all four
  sides have the same margin size.
  @param margin the size of margin.