0

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();

Image of the Plot is here

1 Answers1

0

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?

figbar
  • 602
  • 7
  • 26