title: Python: How to draw some boxplots for data frames using matplotlib?
body: <p>I have a Pandas dataframe with 4 columns - <code>id</code>, <code>label</code>, <code>var1</code> and <code>var2</code>. </p>
  
  <p>From this data, I would like to draw two box plots each for <code>var1</code> and <code>var2</code> - one for where the <code>label==0</code> and the other for where <code>label==1</code>.</p>
  
  <p>Sample dataframe:</p>
  
  <pre><code>+-----+-----+----+----+
  | id  |label|var1|var2|
  +-----+-----+----+----+
  | 1   |  0  | 0.7| 0.6|
  | 2   |  0  | 0.3| 0.4|
  | 3   |  1  | 0.2| 0.2|
  | 4   |  1  | 0.8| 0.1|
  | 5   |  0  | 0.0| 0.9|
  +-----+-----+----+----+
  </code></pre>
  
  <p>Code to generate dataframe:</p>
  
  <pre><code>l=[(1,0,0.7,0.6),(2,0,0.3,0.4),(3,1,0.2,0.2),(4,1,0.8,0.1),(5,0,0.0,0.9)]
  names=["id","label", "var1", "var2"]
  db=sqlContext.createDataFrame(l,names)
  db.show()
  db = db.toPandas()
  </code></pre>
  
  <p>How can I implement this using <a href="https://matplotlib.org/" rel="nofollow noreferrer">matplotlib</a>?</p>