Consider I have the following dataframe:
sample | tca_after | avg_length_after | cd_after | tca_before | avg_length_before | cd_before |
---|---|---|---|---|---|---|
1 | 0.015385 | 50.513499 | 1.4 | 0.005139 | 31.844415 | 0.4 |
2 | 0.005040 | 19.209373 | 1.0 | 0.004603 | 20.831459 | 0.6 |
3 | 0.057218 | 31.869649 | 10.0 | 0.008687 | 17.926937 | 1.0 |
4 | 0.037175 | 45.543659 | 3.8 | 0.035760 | 56.937708 | 2.8 |
I want to compare TCA, avg_length, and CD, before and after a certain process. So I would like to create three categorical histograms like
To create a bar plot with the sample IDs on the x axis, you can change sns.histplot
to sns.barplot
:
sns.barplot(data=df_new, x='sample', y='tca', hue='when', palette='copper_r', dodge=True)