docstr: plot the mean function and optionally the scatter of the sample
  
  Parameters
  ----------
  scatter : bool
      If true, then add scatterpoints of sample to plot.
  ax : None or matplotlib axis instance
      If None, then a matplotlib.pyplot figure is created, otherwise
      the given axis, ax, is used.
  
  Returns
  -------
  Figure
      This is either the created figure instance or the one associated
      with ax if ax is given.
docstr_tok: ["plot","the","mean","function","and","optionally","the","scatter","of","the","sample","Parameters","--","--","--","--","--","scatter",":","bool","If","true",",","then","add","scatterpoints","of","sample","to","plot",".","ax",":","None","or","matplotlib","axis","instance","If","None",",","then","a","matplotlib.pyplot","figure","is","created",",","otherwise","the","given","axis",",","ax",",","is","used",".","Returns","--","--","--","-","Figure","This","is","either","the","created","figure","instance","or","the","one","associated","with","ax","if","ax","is","given","."]
code: def plot(self, scatter=True, ax=None):
      """plot the mean function and optionally the scatter of the sample
  
      Parameters
      ----------
      scatter : bool
          If true, then add scatterpoints of sample to plot.
      ax : None or matplotlib axis instance
          If None, then a matplotlib.pyplot figure is created, otherwise
          the given axis, ax, is used.
  
      Returns
      -------
      Figure
          This is either the created figure instance or the one associated
          with ax if ax is given.
  
      """
      if ax is None:
          import matplotlib.pyplot as plt
  
          fig = plt.figure()
          ax = fig.add_subplot(1, 1, 1)
  
      if scatter:
          ax.plot(self.x, self.y, "o", alpha=0.5)
  
      xx = np.linspace(self.x.min(), self.x.max(), 100)
      ax.plot(xx, self.func(xx), lw=2, color="b", label="dgp mean")
      return ax.figure
  
imports: import numpy
label_desc: Use image node_id 2 for calling the _UnivariateFunction obj's underlying member method code with example usage: obj.plot(scatter, ax) and returns: ax