Plotting bar plot in Seaborn Python with rotated xlabels
<p>How can I plot a simple bar graph in Seaborn without any statistics? The data set is simply names and values.</p>

<pre><code>import pandas
df = pandas.DataFrame({"name": ["Bob Johnson", "Mary Cramer", "Joe Ellis"], "vals": [1,2,3]})
</code></pre>

<p>I would like to plot this as a bar graph with xlabels pulled from <code>name</code> column and y-axis values from <code>vals</code> and have x-axis labels rotated 45 degrees. How can it be done? Using <code>sns.barplot</code> like:</p>

<pre><code>sns.barplot(x="name", y="vals", data=df)
</code></pre>

<p>will compute statistics that are not relevant here. </p>

<p>You mean like that (<strong>set_xticklabels</strong> approach):</p>

<pre><code>import pandas

df = pandas.DataFrame({"name": ["Bob Johnson", "Mary Cramer", "Joe Ellis"], "vals": [1,2,3]})
g = sns.barplot(x='name', y='vals', data=df)
g.set_xticklabels(g.get_xticklabels(), rotation=45)
</code></pre>

<hr>

<p>Or probably <strong>plt.xticks</strong> approach can help:</p>

<pre><code>import pandas
import matplotlib.pylab as plt

df = pandas.DataFrame({"name": ["Bob Johnson", "Mary Cramer", "Joe Ellis"], "vals": [1,2,3]})

bar_plot = sns.barplot(x='name', y='vals', data=df)
plt.xticks(rotation=45)
plt.show()
</code></pre>

python matplotlib bar-chart seaborn