forked from matplotlib/matplotlib
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patherrorbar_limits.py
More file actions
40 lines (28 loc) · 804 Bytes
/
errorbar_limits.py
File metadata and controls
40 lines (28 loc) · 804 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
'''
Illustration of upper and lower limit symbols on errorbars
'''
from math import pi
from numpy import array, arange, sin
import pylab as P
fig = P.figure()
x = arange(10.0)
y = sin(arange(10.0)/20.0*pi)
P.errorbar(x, y, yerr=0.1, capsize=3)
y = sin(arange(10.0)/20.0*pi) + 1
P.errorbar(x, y, yerr=0.1, uplims=True)
y = sin(arange(10.0)/20.0*pi) + 2
upperlimits = array([1, 0]*5)
lowerlimits = array([0, 1]*5)
P.errorbar(x, y, yerr=0.1, uplims=upperlimits, lolims=lowerlimits)
P.xlim(-1, 10)
fig = P.figure()
x = arange(10.0)/10.0
y = (x + 0.1)**2
P.errorbar(x, y, xerr=0.1, xlolims=True)
y = (x + 0.1)**3
P.errorbar(x + 0.6, y, xerr=0.1, xuplims=upperlimits, xlolims=lowerlimits)
y = (x + 0.1)**4
P.errorbar(x + 1.2, y, xerr=0.1, xuplims=True)
P.xlim(-0.2, 2.4)
P.ylim(-0.1, 1.3)
P.show()