2808 explained code solutions for 75 technologies


python-matplotlibHow to change figure size


In order to set figure size, you set size in inches and also change inch size in pixels (we draw 160x160 chart in this example):

import matplotlib.pyplot as plt
plt.figure(figsize=(2, 2), dpi=80)
plt.plot([4,2,11,2,1,20,25])
plt.show()ctrl + c
import matplotlib.pyplot as plt

loads Matplotlib module to use plotting capabilities

.figure(

change figure params

figsize

set figure size in inches

dpi

inch size in pixels (80 in our case)

.plot(

plot specified data

.show()

render chart in a separate window