title: How to remove axis, legends, and white padding
body: <p>I would like to apply colormap to an image, and write the resulting image, without using axes, labels, titles, or anything automatically added by matplotlib. Here is what I did:</p>
  <pre><code>def make_image(inputname,outputname):
      data = mpimg.imread(inputname)[:,:,0]
      fig = plt.imshow(data)
      fig.set_cmap('hot')
      fig.axes.get_xaxis().set_visible(False)
      fig.axes.get_yaxis().set_visible(False)
      plt.savefig(outputname)
  </code></pre>
  <p>It successfully removes the axis of the figure, but the figure saved, presents a white padding, and a frame around the actual image.</p>
  <p>How can I remove them (at least the white padding)?</p>