No outlines on bins of Matplotlib histograms or Seaborn distplots

As part of the update to matplotlib 2.0 the edges on bar plots are turned off by default. However, you may use the rcParam plt.rcParams[“patch.force_edgecolor”] = True to turn the edges on globally. Probably the easiest option is to specifically set the edgecolor when creating a seaborn plot, using the hist_kws argument, ax = sns.distplot(x, … Read more

Increase tick label font size in seaborn

The answer from here makes fonts larger in seaborn … import pandas as pd, numpy as np, seaborn as sns from matplotlib import pyplot as plt # Generate data df = pd.DataFrame({“Draughts”: np.random.randn(100)}) # Plot using seaborn sns.set(font_scale = 2) b = sns.violinplot(y = “Draughts”, data = df) plt.show()

Seaborn Bar Plot Ordering

you can use the order parameter for this. sns.barplot(x=’Id’, y=”Speed”, data=df, order=result[‘Id’]) Credits to Wayne. See the rest of his code. This link is still working for me. But, for the sake of convenience, I’m pasting the author’s code here. result = df.groupby([“Id”])[‘Speed’].aggregate(np.median).reset_index().sort_values(‘Speed’) sns.barplot(x=’Id’, y=”Speed”, data=df, order=result[‘Id’]) plt.show() df Id Speed 0 1 30 1 … Read more

How to add bold annotated text to a plot

Adding annotations / text also works in seaborn axes-level plots with the same methods. For seaborn figure-level plots, you must iterate through each axes, which isn’t shown. Bold text can be specified with .text or .annotate matplotlib.pyplot.text Use the weight or fontweight parameter. matplotlib.pyplot.annotate, which uses the same kwargs as .text. Note: If LaTex fonts, … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)