I am trying to plot 2 related plots of House Size vs House Price & No. Of Rooms vs House Price However the size of each subplot I'm getting is pretty small. How can I tweak the sizes of both Subplots so as to be big enough.
import matplotlib.pyplot as plt
#X is a Matrix of dimension (47,2), Y is column vector dim=(47,1)
plt.subplots_adjust(wspace=4);
plt.subplot(1,2,1);
plt.scatter(X[:,0],y);
plt.subplot(1,2,2);
plt.scatter(X[:,1],y);
plt.show();
inserting figsize
should work. So your new code could look like:
import matplotlib.pyplot as plt
plt.subplots(1,2,figsize=(15,15))#one example of sizing
plt.subplots_adjust(wspace=4);
plt.subplot(1,2,1);
plt.scatter(X[:,0],y);
plt.subplot(1,2,2);
plt.scatter(X[:,1],y);
plt.show();
see this post: How do I change the figure size with subplots?
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.