i have this plot of a dataframe with seaborn's facetgrid:
import seaborn as sns
import matplotlib.pylab as plt
import pandas
import numpy as np
plt.figure()
df = pandas.DataFrame({"a": map(str, np.arange(1001, 1001 + 30)),
"l": ["A"] * 15 + ["B"] * 15,
"v": np.random.rand(30)})
g = sns.FacetGrid(row="l", data=df)
g.map(sns.pointplot, "a", "v")
plt.show()
seaborn plots all the xtick labels instead of just picking a few and it looks horrible:
Is there a way to customize it so that it plots every n-th tick on x-axis instead of all of them?
The
seaborn.pointplot
is not the right tool for this plot. But the answer is very simple: use the basicmatplotlib.pyplot.plot
function:You have to skip x labels manually like in this example: