title: matplotlib ax to figure extent - remove whitespace, borders, everything for plot of geopandas map
body: <p>I am looking for a solution to have a seamless map image plot with matplotlib. The current code works good and stable, however, it leaves a whitespace to the left and bottom. I would like to remove this whitespace and don't know how.</p>
  
  <p>My sample code for this:</p>
  
  <pre><code>import geopandas
  from seaborn import despine
  from pandas import read_csv
  import matplotlib.pyplot as plt
  
  # read data and shapefile
  geo_path = 'shapefiles/ne_10m_admin_0_countries.shp'
  df = read_csv('UNpopEstimates2100.csv')
  world = geopandas.read_file(geo_path)
  
  # specifiy what is to be plotted
  cm = 'Greys'
  world['2015'] = df['2015']
  
  # set plot environment
  fig = plt.figure()
  ax = fig.add_axes([0, 0, 1, 1])
  ax.axis('off')
  plt.subplots_adjust(left=0, right=1, bottom=0, top=1)
  
  world.plot(ax=ax, column='2015', cmap=cm, scheme='quantiles')
  
  plt.savefig('sample.png', bbox_inches='tight', tight_layout=True, pad_inches=0, frameon=None)
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/E8nCn.png" rel="nofollow noreferrer">sample.png</a></p>
  
  <p><a href="https://i.stack.imgur.com/E5AX0.jpg" rel="nofollow noreferrer">smaple.png with   marked whitespace I would like to remove</a></p>
  
  <p>I followed the Tutorial at <a href="https://matplotlib.org/users/tight_layout_guide.html" rel="nofollow noreferrer">Matplotlib's Tight Layout guide</a>, <a href="https://www.machinelearningplus.com/plots/matplotlib-tutorial-complete-guide-python-plot-examples/#10.-How-to-customize-matplotlib&#39;s-subplots-layout" rel="nofollow noreferrer">machinelearningplus.com</a>, <a href="https://www.reddit.com/r/learnpython/comments/5e54pk/removing_white_padding_from_figure/" rel="nofollow noreferrer">Removing white padding from figure on Reddit</a> as well as several other stackoverflow posts, namely</p>
  
  <p><a href="https://stackoverflow.com/questions/40726323/matplotlib-scatter-plot-remove-white-padding">Matplotlib scatter plot - Remove white padding</a>,</p>
  
  <p><a href="https://stackoverflow.com/questions/24535393/matplotlib-getting-subplots-to-fill-figure">Matplotlib: Getting subplots to fill figure</a>,</p>
  
  <p><a href="https://stackoverflow.com/questions/9295026/matplotlib-plots-removing-axis-legends-and-white-spaces">Matplotlib plots: removing axis, legends and white spaces</a>,</p>
  
  <p><a href="https://stackoverflow.com/questions/11837979/removing-white-space-around-a-saved-image-in-matplotlib">Removing white space around a saved image in matplotlib</a></p>
  
  <p>and</p>
  
  <p><a href="https://stackoverflow.com/questions/42614415/matplotlib-plot-to-fill-figure-only-with-data-points-no-borders-labels-axes">matplotlib plot to fill figure only with data points, no borders, labels, axes,</a></p>
  
  <p>What am I missing?</p>
  
  <hr>
  
  <p>edit
  - to provide a reproducable version with non-real-life data, but question stays the same - how do I get rid of the whitespace around my plot?  </p>
  
  <p><em>I am new to Geopandas, so I am not sure how to recreate a geodataframe, however, there is built in datasets with it.</em></p>
  
  <pre><code>world = geopandas.read_file(geopandas.datasets.get_path('naturalearth_lowres'))
  world['2015'] = np.random.uniform(low=1., high=100., size=(177,))
  
  fig = plt.figure()
  ax = fig.add_axes([0, 0, 1, 1])
  ax.axis('off')
  plt.subplots_adjust(left=0, right=1, bottom=0, top=1)
  
  world.plot(ax=ax, column='2015', scheme='quantiles')
  
  plt.savefig('sample.png')
  </code></pre>