title: Why can't I plot multiple scatter subplots in one figure for a data set from a DataFrame of Pandas (Python) in the way I plot subplots of histograms?
body: <p>I am learning how to play with matplotlib recently. However, some problems come up. I read in a non-standard data file named students.data with the following command.</p>
  
  <pre><code>student_dataset = pd.read_csv("students.data", index_col=0)
  </code></pre>
  
  <p>Here is how students.data looks like.</p>
  
  <p><a href="https://i.stack.imgur.com/WHHrE.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/WHHrE.png" alt="enter image description here"></a></p>
  
  <p>Then I plot a figure with four subplots of histograms in it with the following commands.</p>
  
  <pre><code>fig = plt.figure(0) #Use it to create subplots.
  fig.subplots_adjust(hspace=0.5, wspace=0.5) #Adjust height-spacing to 
                                              #de-overlap titles and ticks
  
  ax1 = fig.add_subplot(2, 2, 1)
  my_series1 = student_dataset["G1"]
  my_series1.plot.hist(alpha=0.5, color = "blue", histtype = "bar", bins = 30)
  
  ax2 = fig.add_subplot(2, 2, 2)
  my_series2 = student_dataset["G2"]
  my_series2.plot.hist(alpha=1, color = "green", histtype = "step", bins = 20)
  
  ax3 = fig.add_subplot(2, 2, 3)
  my_series3 = student_dataset["G3"]
  my_series3.plot.hist(alpha=0.5, color = "red", histtype = "stepfilled")
  
  ax4 = fig.add_subplot(2, 2, 4)
  my_series1.plot.hist(alpha=0.5, color = "blue")
  my_series2.plot.hist(alpha=0.5, color = "green")
  my_series3.plot.hist(alpha=0.5, color = "red")
  </code></pre>
  
  <p>And the result is exactly the stuff I want. However, as I try to do so for scatter subplots, they are separated in different figures. And I cannot figure out why. Here are the commands.</p>
  
  <pre><code>fig = plt.figure(2)
  ax1 = fig.add_subplot(2, 2, 1)
  student_dataset.plot.scatter(x = "freetime", y = "G1")
  
  ax2 = fig.add_subplot(2, 2, 2)
  student_dataset.plot.scatter(x = "freetime", y = "G2")
  
  ax3 = fig.add_subplot(2, 2, 3)
  student_dataset.plot.scatter(x = "freetime", y = "G3")
  </code></pre>
  
  <p>After searching for a day, I find <a href="https://stackoverflow.com/questions/45493053/matplotlib-create-multiple-subplot-in-one-figure">the solution</a> that almost fits my target. But, still, why? Why my original method is not working? </p>
  
  <p>Here are the new commands and the result. </p>
  
  <pre><code>fig, axes = plt.subplots(2, 2, figsize=(6, 6), sharex=False, sharey=False)
  
  x = student_dataset["freetime"].values
  for i in range(3):
      axes[i//2, i%2].scatter(x, student_dataset.iloc[:, i + 25].values)
  
  fig.tight_layout()
  </code></pre>
  
  <p>Sorry that I cannot put more images in this post to describe my question. Hope you can understand my point.</p>
  
  <p>Thanks in advance.</p>