title: Having trouble to display the graph of a function
body: <p>Given a function f(x), how to ?</p>
  <p>Generate the graph of the function and its derivative function on a figure with one bottom and top subplots that share the x-axis.<br />
  Both axes take their form with an input array with values from min to max
  that are spaced by 0.5.
  Each subplot must have a title
  The top subplot must have the ylabel, whereas the bottom subplot must have both xlabel and ylabel
  Each subplot shot have different styles of lines (colors, thickness, ...) and x ticks must also be in a different style(specifically the fontsize and rotation).</p>
  <p>I did this :</p>
  <pre><code>#the function is f(x) while the derivative is df(x)
  
  x = np.arange(min, max, 0.5) #scale
  
  figure, (top, bottom) = plt.subplots(2, sharex=True, figsize = [5.0, 7.0])
  top.plot(x, f(x), 'b', linewidth = 5)
  top.set_title(Function f(x))
  top.ylabel('f(x)')
  figure.set_xticks(colors = 'r', fontsize = 12, rotation = 30)
  
  bottom.plot(x, df(x), 'g-', linewidth = 8) 
  bottom.set_title('Derivative function of f(x)')
  bottom.xlabel('x')
  bottom.ylabel('df(x)')
  
  plt.show(figure)
  </code></pre>
  <p>But it does not work. How could I fix everything ?</p>
  <p>Edited for generalization</p>