FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
matplotlib.github.com/examples/frontpage/plot_contour.py at master · 2236zml/matplotlib.github.com · GitHub
2236zml
/
matplotlib.github.com
Public
forked from
matplotlib/matplotlib.github.com
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
matplotlib.github.com
/
examples
/
frontpage
/
plot_contour.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
34 lines (28 loc) · 817 Bytes
Breadcrumbs
matplotlib.github.com
/
examples
/
frontpage
/
plot_contour.py
Copy path
File metadata and controls
34 lines (28 loc) · 817 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
32
33
34
"""
=========================
Frontpage contour example
=========================
This example reproduces the frontpage contour example.
"""
import
matplotlib
.
pyplot
as
plt
import
numpy
as
np
from
matplotlib
import
mlab
,
cm
extent
=
(
-
3
,
3
,
-
3
,
3
)
delta
=
0.5
x
=
np
.
arange
(
-
3.0
,
4.001
,
delta
)
y
=
np
.
arange
(
-
4.0
,
3.001
,
delta
)
X
,
Y
=
np
.
meshgrid
(
x
,
y
)
Z1
=
mlab
.
bivariate_normal
(
X
,
Y
,
1.0
,
1.0
,
0.0
,
-
0.5
)
Z2
=
mlab
.
bivariate_normal
(
X
,
Y
,
1.5
,
0.5
,
1
,
1
)
Z
=
(
Z1
-
Z2
)
*
10
levels
=
np
.
linspace
(
-
2.0
,
1.601
,
40
)
norm
=
cm
.
colors
.
Normalize
(
vmax
=
abs
(
Z
).
max
(),
vmin
=
-
abs
(
Z
).
max
())
fig
,
ax
=
plt
.
subplots
()
cset1
=
ax
.
contourf
(
X
,
Y
,
Z
,
levels
,
norm
=
norm
)
ax
.
set_xlim
(
-
3
,
3
)
ax
.
set_ylim
(
-
3
,
3
)
ax
.
set_xticks
([])
ax
.
set_yticks
([])
fig
.
savefig
(
"contour_frontpage.png"
,
dpi
=
25
)
# results in 160x120 px image
Back
|
FazBrowse Home
|
New Git URL