FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
matplotlib.github.com/2.2.2/users/dflt_style_changes-9.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
/
2.2.2
/
users
/
dflt_style_changes-9.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
34 lines (27 loc) · 1.26 KB
Breadcrumbs
matplotlib.github.com
/
2.2.2
/
users
/
dflt_style_changes-9.py
Copy path
File metadata and controls
34 lines (27 loc) · 1.26 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
import
matplotlib
.
pyplot
as
plt
import
numpy
as
np
from
matplotlib
import
rc_context
import
matplotlib
.
patches
as
mpatches
fig
,
all_ax
=
plt
.
subplots
(
3
,
2
,
figsize
=
(
4
,
6
),
tight_layout
=
True
)
def
demo
(
ax_top
,
ax_mid
,
ax_bottom
,
rcparams
,
label
):
labels
=
'Frogs'
,
'Hogs'
,
'Dogs'
,
'Logs'
fracs
=
[
15
,
30
,
45
,
10
]
explode
=
(
0
,
0.05
,
0
,
0
)
ax_top
.
set_title
(
label
)
with
rc_context
(
rc
=
rcparams
):
ax_top
.
pie
(
fracs
,
labels
=
labels
)
ax_top
.
set_aspect
(
'equal'
)
ax_mid
.
bar
(
range
(
len
(
fracs
)),
fracs
,
tick_label
=
labels
)
plt
.
setp
(
ax_mid
.
get_xticklabels
(),
rotation
=
-
45
)
grid
=
np
.
mgrid
[
0.2
:
0.8
:
3j
,
0.2
:
0.8
:
3j
].
reshape
(
2
,
-
1
).
T
ax_bottom
.
set_xlim
(
0
,
.75
)
ax_bottom
.
set_ylim
(
0
,
.75
)
ax_bottom
.
add_artist
(
mpatches
.
Rectangle
(
grid
[
1
]
-
[
0.025
,
0.05
],
0.05
,
0.1
))
ax_bottom
.
add_artist
(
mpatches
.
RegularPolygon
(
grid
[
3
],
5
,
0.1
))
ax_bottom
.
add_artist
(
mpatches
.
Ellipse
(
grid
[
4
],
0.2
,
0.1
))
ax_bottom
.
add_artist
(
mpatches
.
Circle
(
grid
[
0
],
0.1
))
ax_bottom
.
axis
(
'off'
)
demo
(
*
all_ax
[:,
0
],
rcparams
=
{
'patch.force_edgecolor'
:
True
,
'patch.facecolor'
:
'b'
},
label
=
'classic'
)
demo
(
*
all_ax
[:,
1
],
rcparams
=
{},
label
=
'v2.0'
)
Back
|
FazBrowse Home
|
New Git URL