FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
matplotlib/examples/style_sheets/fivethirtyeight.py at unpyplot · a52/matplotlib · GitHub
a52
matplotlib
Repository navigation
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
matplotlib
/
examples
/
style_sheets
/
fivethirtyeight.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
31 lines (22 loc) · 779 Bytes
Breadcrumbs
matplotlib
/
examples
/
style_sheets
/
fivethirtyeight.py
Copy path
File metadata and controls
31 lines (22 loc) · 779 Bytes
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
"""
===========================
FiveThirtyEight style sheet
===========================
This shows an example of the "fivethirtyeight" styling, which
tries to replicate the styles from FiveThirtyEight.com.
"""
import
matplotlib
.
pyplot
as
plt
import
numpy
as
np
plt
.
style
.
use
(
'fivethirtyeight'
)
x
=
np
.
linspace
(
0
,
10
)
# Fixing random state for reproducibility
np
.
random
.
seed
(
19680801
)
fig
,
ax
=
plt
.
subplots
()
ax
.
plot
(
x
,
np
.
sin
(
x
)
+
x
+
np
.
random
.
randn
(
50
))
ax
.
plot
(
x
,
np
.
sin
(
x
)
+
0.5
*
x
+
np
.
random
.
randn
(
50
))
ax
.
plot
(
x
,
np
.
sin
(
x
)
+
2
*
x
+
np
.
random
.
randn
(
50
))
ax
.
plot
(
x
,
np
.
sin
(
x
)
-
0.5
*
x
+
np
.
random
.
randn
(
50
))
ax
.
plot
(
x
,
np
.
sin
(
x
)
-
2
*
x
+
np
.
random
.
randn
(
50
))
ax
.
plot
(
x
,
np
.
sin
(
x
)
+
np
.
random
.
randn
(
50
))
ax
.
set_title
(
"'fivethirtyeight' style sheet"
)
plt
.
show
()
Back
|
FazBrowse Home
|
New Git URL