Solved

Error bars in matplotlib

Posted on 2011-09-13
2
568 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 250 total points
ID: 36528923
0
 

Author Closing Comment

by:IssacJones
ID: 36529554
Thanks pepr
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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…
Flask is a microframework for Python based on Werkzeug and Jinja 2. This requires you to have a good understanding of Python 2.7. Lets install Flask! To install Flask you can use a python repository for libraries tool called pip. Download this f…
Learn the basics of if, else, and elif statements in Python 2.7. Use "if" statements to test a specified condition.: The structure of an if statement is as follows: (CODE) Use "else" statements to allow the execution of an alternative, if the …
Learn the basics of while and for loops in Python.  while loops are used for testing while, or until, a condition is met: The structure of a while loop is as follows:     while <condition>:         do something         repeate: The break statement m…

679 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