FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
matplotlib.github.com/1.2.1/pyplots/boxplot_demo.py at main · matplotlib/matplotlib.github.com · GitHub
matplotlib
/
matplotlib.github.com
Public
Notifications
You must be signed in to change notification settings
Fork
62
Star
29
Code
Issues
1
Pull requests
2
Actions
Projects
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
matplotlib.github.com
/
1.2.1
/
pyplots
/
boxplot_demo.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
65 lines (53 loc) · 1.25 KB
Breadcrumbs
matplotlib.github.com
/
1.2.1
/
pyplots
/
boxplot_demo.py
Copy path
File metadata and controls
65 lines (53 loc) · 1.25 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#!/usr/bin/python
#
# Example boxplot code
#
from
pylab
import
*
# fake up some data
spread
=
rand
(
50
)
*
100
center
=
ones
(
25
)
*
50
flier_high
=
rand
(
10
)
*
100
+
100
flier_low
=
rand
(
10
)
*
-
100
data
=
concatenate
((
spread
,
center
,
flier_high
,
flier_low
),
0
)
# basic plot
boxplot
(
data
)
#savefig('box1')
# notched plot
figure
()
boxplot
(
data
,
1
)
#savefig('box2')
# change outlier point symbols
figure
()
boxplot
(
data
,
0
,
'gD'
)
#savefig('box3')
# don't show outlier points
figure
()
boxplot
(
data
,
0
,
''
)
#savefig('box4')
# horizontal boxes
figure
()
boxplot
(
data
,
0
,
'rs'
,
0
)
#savefig('box5')
# change whisker length
figure
()
boxplot
(
data
,
0
,
'rs'
,
0
,
0.75
)
#savefig('box6')
# fake up some more data
spread
=
rand
(
50
)
*
100
center
=
ones
(
25
)
*
40
flier_high
=
rand
(
10
)
*
100
+
100
flier_low
=
rand
(
10
)
*
-
100
d2
=
concatenate
( (
spread
,
center
,
flier_high
,
flier_low
),
0
)
data
.
shape
=
(
-
1
,
1
)
d2
.
shape
=
(
-
1
,
1
)
#data = concatenate( (data, d2), 1 )
# Making a 2-D array only works if all the columns are the
# same length. If they are not, then use a list instead.
# This is actually more efficient because boxplot converts
# a 2-D array into a list of vectors internally anyway.
data
=
[
data
,
d2
,
d2
[::
2
,
0
]]
# multiple box plots on one figure
figure
()
boxplot
(
data
)
#savefig('box7')
show
()
Back
|
FazBrowse Home
|
New Git URL