1

I pass the edgecolor=none to the plot to make the edge of the graph disappear. The whole code appears like this:

sns.countplot(x="Survived", data=titanic_df, ax=ax1, palette='Pastel1', edgecolor='none')

However, I have to do this everytime when I'm visualizing graphs which is annoying. How can I set seaborn / matplolib up to default edgecolor to none???

Thanks!

Cecilia Lee
  • 775
  • 1
  • 11
  • 20

1 Answers1

1

You seem to be using an older version of matplotlib. Matplotlib version 2.0 does not have edges on bars by default. Therefore an easy solution may be to update matplotlib and seaborn to the newest versions.

Essentially you are asking for the inverse of this question No outlines on bins of Matplotlib histograms or Seaborn distplots .

Using either of

plt.rcParams['patch.linewidth'] = 0
plt.rcParams['patch.edgecolor'] = 'none'

at the beginning of the script (but potentially after importing seaborn, if an older version of seaborn is used) should give the desired result of no edges on patches like bars.

If the edges disappear by some other mechanism and you are actually using matplotlib 2.0, you may need to set

plt.rcParams["patch.force_edgecolor"] = False

in addition.

ImportanceOfBeingErnest
  • 321,279
  • 53
  • 665
  • 712