modify pandas boxplot output
<p>I made this plot in pandas, according to the documentation:</p>

<pre><code>import pandas as pd
import numpy as np
import pyplot as plt

df = pd.DataFrame(np.random.rand(140, 4), columns=['A', 'B', 'C', 'D'])
df['models'] = pd.Series(np.repeat(['model1','model2', 'model3', 'model4', 'model5', 'model6', 'model7'], 20))
plt.figure()
bp = df.boxplot(by="models")
</code></pre>

<p><a href="https://i.stack.imgur.com/2So7W.png" rel="nofollow"><img src="https://i.stack.imgur.com/2So7W.png" alt="enter image description here"></a></p>

<p>How can I modify this plot?</p>

<p>I want:</p>

<ul>
<li>modify arrangement from (2,2) to (1,4)</li>
<li>change the labels and titles, text and font size</li>
<li>remove the '[models]' text</li>
</ul>

<p>and how do I save this plot as pdf ?</p>

<p>A number of things you can do already using the boxplot function in pandas, see the <a href="http://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.boxplot.html" rel="nofollow">documentation</a>. </p>

<ul>
<li><p>You can already modify the arrangement, and change the fontsize: </p>

<pre><code>import pandas as pd
import numpy as np
import pyplot as plt

df = pd.DataFrame(np.random.rand(140, 4), columns=['A', 'B', 'C', 'D'])
df['models'] = pd.Series(np.repeat(['model1','model2', 'model3', 'model4', 'model5', 'model6', 'model7'], 20))
bp = df.boxplot(by="models", layout = (4,1), fontsize = 14)
</code></pre></li>
<li><p>Changing the columns the labels can be done by changing the columns labels of the dataframe itself:</p>

<pre><code>df.columns(['E', 'F', 'G', 'H', 'models'])
</code></pre></li>
<li><p>For further customization I would use the functionality from matlotlib itself; you can take a look at the examples <a href="http://matplotlib.org/examples/statistics/boxplot_demo.html" rel="nofollow">here</a>. </p></li>
</ul>

python pandas matplotlib