0

I am using Seaborn to plot a violin graph (as you can see on the pic below): Violin Plot

I would like to emphasize the line at the 0 level on the y-axis (Comparison_perc) and then make it slightly bigger/darker.

Would you know how?

Many thanks,

Guillaume

1 Answers1

2

I believe you can add a horizontal line using axhline() e.g.

#Import libraries
import seaborn as sns
import matplotlib.pyplot as plt

#Load example dataset
dataset = sns.load_dataset("iris")

#Create graph
graph = sns.barplot(x="sepal_width", y="petal_width", data=dataset)

#Draw a horizontal line at 0
graph.axhline(y=0)

#Show plot
plt.show()

And you can change the color/thickness etc, e.g. graph.axhline(y=0, linewidth=4, color='r')

jared_mamrot
  • 22,354
  • 4
  • 21
  • 46