import matplotlib.pyplot as plt
fig = plt.figure(figsize=(20, 20))
ax = plt.subplot(111, aspect='equal')
plt.subplots_adjust(left=0, bottom=0, right=1, top=1, wspace=0, hspace=0)
Matplotlib adjust figure margin