9951 explained code solutions for 126 technologies

python-matplotlibHow to set subplot size

In order to change subplots sizes we use figsize() method:

import matplotlib.pyplot as plt

fig, axes = plt.subplots(nrows=1, ncols=2, figsize=(4,2))


plt.show()ctrl + c
import matplotlib.pyplot as plt

loads Matplotlib module to use plotting capabilities


creates set of charts on a single chart area


set figure size in inches (also set dpi to specify inch size in pixels)


plot specified data


render chart in a separate window