title: Three subplots in Python using the same data
body: <p>I'm currently needing some help here since I’m kinda novice. So I was able to import and plot my time series data via Pandas and Matplotlib, respectively. The thing is, the plot is too cramped up (due to the amount of data lol).</p>
  <p>Using the same data set, is it possible to ‘divide’ the whole plot into 3 separate subplots?</p>
  <p>Here's a sample to what I mean:<br />
  <a href="https://i.stack.imgur.com/mFg2t.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/mFg2t.png" alt="enter image description here" /></a></p>
  <p>What I'm trying to do here is to distribute my plot into 3 subplots (it seems it doesn't have <code>ncol=x</code>).</p>
  <p>Initially, my code runs like this;</p>
  <pre><code>import numpy as np
  import matplotlib.pyplot as plt
  import matplotlib.ticker as ticker
  import pandas as pd
  
  pd.options.display.float_format = '{:,.4f}'.format
  data = pd.read_csv ('all_visuallc.csv')   
  df = pd.DataFrame(data, columns= ['JD', 'Magnitude'])
  print(df) #displays ~37000ish data x 2 columns
  
  colors = ('#696969') #a very nice dim grey heh
  area = np.pi*1.7
  
  ax = df.plot.scatter(x=&quot;JD&quot;, y=&quot;Magnitude&quot;, s=area, c=colors, alpha=0.2)
  ax.set(title='HD 39801', xlabel='Julian Date', ylabel='Visual Magnitude')
  ax.invert_yaxis()
  ax.xaxis.set_minor_locator(ticker.AutoMinorLocator())
  ax.yaxis.set_minor_locator(ticker.AutoMinorLocator())
  
  plt.rcParams['figure.figsize'] = [20, 4]
  plt.rcParams['figure.dpi'] = 250
  plt.savefig('test_p.jpg')
  plt.show()
  </code></pre>
  <p>which shows a very tight plot:</p>
  <p><a href="https://i.stack.imgur.com/kJ2Tf.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/kJ2Tf.jpg" alt="enter image description here" /></a></p>
  <p>Thanks everyone and I do hope for your help and responses.</p>
  <p><em>P.S. I think</em> <code>iloc[value:value]</code> <em>to slice from a df may work?</em></p>