2

I have a time series stored in pandas DataFrame with columns low, average, and high. Currently, I plot the average values as a line chart, but I would like to fill the area between low and high values with a color.

I am hoping to create a chart that looks exactly like this

example

1
  • What have you tried? Anything that looks promising but you can't get it to work? Commented Apr 30, 2017 at 1:24

1 Answer 1

3

I think it's something like:

ax.fill_between(df.index, df.upper, df.lower, where= df.upper > df.lower,
facecolor='red', alpha=0.5, interpolate=True)

Where ax is your axis, df is the DataFrame and upper and lower the bounds.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.