0

I am wondering whether I can plot a graph in which I show a range of best and worst results using matplotlib. The result should look something like this:

Image of the graph I want to replicate here.

You see the ranges around each point that specify what the best and worst measure is? This is exactly what I am looking for.

1 Answer 1

1

I'm pretty sure the errorbar function does exactly what you want: https://matplotlib.org/3.5.0/api/_as_gen/matplotlib.pyplot.errorbar.html

import numpy as np
import matplotlib.pyplot as plt
x = np.arange(10)
y = np.arange(10)
# yerr can be a single number or an array with same length as x and y
# depending on whether you want it to be constant or changing
yerr = 1
plt.errorbar(x, y, yerr=yerr)
plt.show()
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.