Change the relative size of a subplot

See the grid-spec tutorial:

http://matplotlib.sourceforge.net/users/gridspec.html

Example code:

import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec

f = plt.figure()

gs = gridspec.GridSpec(1, 2,width_ratios=[2,1])
              
ax1 = plt.subplot(gs[0])
ax2 = plt.subplot(gs[1])

plt.show()

enter image description here

You can also adjust the height ratio using a similar option in GridSpec

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)