title: How to force equal subplot size
body: <p>I am trying to plot 3 graphs in a single row, but all plots should be the same size (at least the same height).</p>
  
  <pre><code>import numpy as np
  import matplotlib.pyplot as plt
  from mpl_toolkits.mplot3d import Axes3D
  import matplotlib.gridspec as gridspec
  
  x = np.random.uniform(size=2000) - 0.5
  y = np.random.uniform(size=2000) - 0.5
  z = np.random.uniform(size=2000) - 0.5
  DPI = 106
  
  fig = plt.figure(figsize=(900 / DPI, 350 / DPI))
  gs = gridspec.GridSpec(1, 3, width_ratios=[1,1,1])
  
  # 1D
  r = np.abs(x)
  # plot
  ax1 = fig.add_subplot(gs[0])
  plot = ax1.scatter(x, r, s = 1, c=r, cmap='jet', marker='.', alpha = 1, vmax = 0.5)
  ax1.set_xlabel('$x$')
  ax1.set_ylabel('$y$')
  ax1.set_aspect('equal')
  
  # 2D
  r = np.sqrt(x * x + y * y)
  # plot
  ax2 = fig.add_subplot(gs[1])
  plot = ax2.scatter(x, y, s = 1, c=r, cmap='jet', marker='.', alpha = 1, vmax = 0.5)
  ax2.set_xlabel('$x$')
  ax2.set_ylabel('$y$')
  ax2.set_aspect('equal')
  fig.colorbar(plot, shrink = 1, ax = ax2)
  
  
  # 3D
  r = np.sqrt(x * x + y * y + z * z)
  ax3 = fig.add_subplot(gs[2], projection='3d')
  plot = ax3.scatter(x, y, z, s = 10, c=r, cmap='jet', marker='.', alpha = 1, vmax = 0.5)
  
  ax3.set_xlabel('$x$')
  ax3.set_ylabel('$y$')
  ax3.set_zlabel('$z$')
  ax3.view_init(30, 240)
  ax3.set_aspect('equal', 'box')
  fig.colorbar(plot, shrink = 1,ax = ax3)
  
  fig.tight_layout()
  </code></pre>
  
  <p>The code above does produce three columns of plots, first 1D, than 2D and lastly a 3D plot. However, as you can see from attached image, the plots are not of the same size eventhough I tried using <code>gridspec</code>as suggested <a href="https://stackoverflow.com/a/29118050/5970596">here</a>. </p>
  
  <p><a href="https://i.stack.imgur.com/6zOkW.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/6zOkW.png" alt="enter image description here"></a></p>
  
  <p>Any ideas on how to change the size of subplots?</p>