I am using the below script to get the histogram plot for all values together. However, I want a single plot but different colours for different groups (A, B, C)
data file
Group_name code-1 code-2 Expression
GroupA 6 6 1.21
GroupA 6 8 0.611
GroupA 6 1 0.448
GroupA 6 3 0.3587
GroupB 8 6 0.611
GroupB 8 8 2.11
GroupB 8 1 0.60113
GroupB 8 3 0.534858
GroupC 1 6 0.448
GroupC 1 8 0.60113
GroupC 1 1 2.2
GroupC 1 3 0.622206
Script
import matplotlib.pyplot as plt
import seaborn as sns
plt.rcParams["figure.figsize"] = (12,8)
g1 = sns.histplot(df.Expression)
g1.set(
xlim=(-2,2),
title="Expression"
)
g1.axvline(0.0, c='black', linestyle="--")
g1.axvline(df.Expression.median(), c='red', linestyle="--")
```