I am trying to plot negative values with bars in Python, which start from a low negative value and end at the given negative value. This is how it should look (Excel-Plot), negative values' bars starting at -60:
Here the definition of the horizontal axis intersection at "-60" does the trick.
My code:
import matplotlib.pyplot as plt
import pandas as pd
f = pd.DataFrame({"x":range(9), "y": [-21,-24,-27,-30,-33, -36,-39,-42,-45 ]})
plt.bar(f.x, f.y, bottom= -60)
plt.gca().invert_yaxis()
plt.show()
shows:
The bars start at -60, but the inverse y-axis values ruin it.
Is there any way to plot bars growing from the bottom up to their negative value, with the correct y-axis values (for example, bottom y-value: -60, top y-value: 0)?



