Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Error bars in matplotlib

Posted on 2011-09-13
2
Medium Priority
?
654 Views
Last Modified: 2012-05-12
Hi

I would like to plot a graph with errors bars.

Suppose, for example, that my x and y values are

x = (0,1,2,3) and y = (4,7,2,10)

I can plot this using

plt.plot(x,y)
plt.show()

However, what I want to do now is to display some error bars on these points.For example, for the point at x = 0, the y value may not be exactly y=4 and may be a minimum of 3.6 and a maximum of 4.2.

I could like to draw a vertical line between these limits and also write the 3.6 and 4.2 labels on the line (other points would have different errors and labels).

Can anybody tell me how to do this?

Thanks in advance

Issac
0
Comment
Question by:IssacJones
2 Comments
 
LVL 29

Accepted Solution

by:
pepr earned 1000 total points
ID: 36528923
0
 

Author Closing Comment

by:IssacJones
ID: 36529554
Thanks pepr
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Plenty of writing has gone on the web trying to compare Python with other competitive programming languages and vice versa. However, not much has been put into a wholistic perspective. This article should help you decide whether to adopt Python as a…
Strings in Python are the set of characters that, once defined, cannot be changed by any other method like replace. Even if we use the replace method it still does not modify the original string that we use, but just copies the string and then modif…
Learn the basics of strings in Python: declaration, operations, indices, and slicing. Strings are declared with quotations; for example: s = "string": Strings are immutable.: Strings may be concatenated or multiplied using the addition and multiplic…
Learn the basics of modules and packages in Python. Every Python file is a module, ending in the suffix: .py: Modules are a collection of functions and variables.: Packages are a collection of modules.: Module functions and variables are accessed us…
Suggested Courses

916 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question