FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
matplotlib/examples/style_sheets/plot_dark_background.py at master · feisuo/matplotlib · GitHub
feisuo
matplotlib
Repository navigation
Code
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
matplotlib
/
examples
/
style_sheets
/
plot_dark_background.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
23 lines (18 loc) · 568 Bytes
Breadcrumbs
matplotlib
/
examples
/
style_sheets
/
plot_dark_background.py
Copy path
File metadata and controls
23 lines (18 loc) · 568 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
"""
This example demonstrates the "dark_background" style, which uses white for
elements that are typically black (text, borders, etc). Note, however, that not
all plot elements default to colors defined by an rc parameter.
"""
import
numpy
as
np
import
matplotlib
.
pyplot
as
plt
plt
.
style
.
use
(
'dark_background'
)
L
=
6
x
=
np
.
linspace
(
0
,
L
)
ncolors
=
len
(
plt
.
rcParams
[
'axes.prop_cycle'
])
shift
=
np
.
linspace
(
0
,
L
,
ncolors
,
endpoint
=
False
)
for
s
in
shift
:
plt
.
plot
(
x
,
np
.
sin
(
x
+
s
),
'o-'
)
plt
.
xlabel
(
'x-axis'
)
plt
.
ylabel
(
'y-axis'
)
plt
.
title
(
'title'
)
plt
.
show
()
Back
|
FazBrowse Home
|
New Git URL