title: Increase resolution of figure while preserving dimensions in Python matplotlib
body: <p>I have created a figure using the following method:</p>
  
  <pre><code>import matplotlib.pyplot as plt
  %matplotlib inline
  fig1 = plt.figure(figsize=(2, 2), dpi=100)
  </code></pre>
  
  <p>I want to increase the resolution of the figure, so I increased the dpi of <code>fig1</code> from 100 to 200. However, this changed the pixel dimensions from (200, 200) to (400, 400), which is something I do not want. If I let dpi=200 and figsize=(1, 1), the pixel dimensions remains (200, 200), but the image looks funny. <a href="https://i.stack.imgur.com/BInZo.png" rel="nofollow noreferrer">Please see the output from my Jupyter notebook here</a>.</p>
  
  <p>Is there a way in Matplotlib to <strong>increase <code>fig1</code>'s resolution without altering its pixel dimension</strong> when rendered in Jupyter?</p>
  
  <p>(Note: the code I used for generating the figures linked to above came from <a href="https://stackoverflow.com/a/47639545/9111293">this question</a>.)</p>