change graph size

Solutions on MaxInterview for change graph size by the best coders in the world

showing results for - "change graph size"
Hector
31 Jun 2016
1import matplotlib.pyplot as plt
2  
3# values on x and y axis
4x = [1, 2, 3, 4, 5]
5y = [6, 7, 8, 9, 10]
6  
7# plot in it's default size
8display(plt.plot(x, y))
9  
10# changing the size of figure to 2X2
11plt.figure(figsize=(2, 2))
12display(plt.plot(x, y))
13