I would like to get a grouped bar that shows both the positive and negative values in one graph. I found a similar question but they are getting the values from a list and not a dataframe. I'm new to using python for graphing so I'm not sure how to change it for a dataframe.
I am able to get something similar to that with my numbers if I make each one individually and then in powerpoint I put the negative number graph below the positive number graph. I feel like there is a better/correct way to do this.
Here is the code I used to get the individual plots
#positive number graph
Positive_CellExterior.plot(x='Pathway',
kind='bar',
stacked=False,
color=['#C4122E','#003663'])
plt.setp(plt.gca(), ylim=(0, 100))
plt.savefig("up.jpg", bbox_inches='tight')
#negative number graph
Negative_CellExterior.plot(x='Pathway',
kind='bar',
stacked=False,
color=['#C4122E','#003663'])
plt.setp(plt.gca(), ylim=(-100,0))
plt.savefig("down.jpg", bbox_inches='tight')
I apologize if this has been asked before. Thank you in advance!
Here are the values if it helps
Positive numbers:
Pathway | WT 23 vs. WT 37 Sig | WT 23 vs. WT 37 NS |
---|---|---|
Transport | 9.84 | 12.97 |
Flagella | 25.93 | 37.04 |
OMP | 8.28 | 12.41 |
Negative numbers:
Pathway | WT 23 vs. WT 37 Sig | WT 23 vs. WT 37 NS |
---|---|---|
Transport | -30.45 | -14.67 |
Flagella | -12.6 | -13.68 |
OMP | -6.7 | -25.93 |