title: matplotlib how to set plot size (with dpi), not figure size
body: <p>I could find a way to set a figure size with dpi</p>
  <pre><code>px = 1/plt.rcParams['figure.dpi']
  fig = plt.figure(figsize=(1580*px, 25*px))
  </code></pre>
  <p>(reference: <a href="https://matplotlib.org/stable/gallery/subplots_axes_and_figures/figure_size_units.html" rel="nofollow noreferrer">https://matplotlib.org/stable/gallery/subplots_axes_and_figures/figure_size_units.html</a>)</p>
  <pre><code>            fig = plt.figure(figsize=(1580*px, 25*px))
              plt.plot(xx, y[0], label='min')
              plt.plot(xx, y[1], label='max')
              plt.yticks(y_ticks, y_tick_labels)
              plt.ylim(top=y_max)
              plt.legend()
  </code></pre>
  <p>However, how do you set the plot size?
  I want my plot or graph to be full of (1580px, 25px)
  but if I set the figure size and plot graphs using the above code, then the graph does not fit the figure (1580px, 25px). Even worse, labels or ticks are not shown well in the figure like below.
  <a href="https://i.stack.imgur.com/cFV0J.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/cFV0J.png" alt="enter image description here" /></a></p>
  <p>I want my graph size to be the above white space size( for example, 1580px, 25px) and then draw ticks and labels outside the white space (then figure size should be bigger than the given plot size). But I couldn't find a way to set the plot size. I could only find a way to set the figure size.</p>