FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
matplotlib/examples/auto_layout.py at transforms · tecki/matplotlib · GitHub
tecki
matplotlib
Repository navigation
Code
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
matplotlib
/
examples
/
auto_layout.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
executable file
·
34 lines (28 loc) · 832 Bytes
Breadcrumbs
matplotlib
/
examples
/
auto_layout.py
Copy path
File metadata and controls
executable file
·
34 lines (28 loc) · 832 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
#!/usr/bin/env python
"""
Example: simple line plot.
Show how to make and save a simple line plot with labels, title and grid
"""
from
pylab
import
*
t
=
arange
(
0.0
,
1.0
+
0.01
,
0.01
)
s
=
cos
(
2
*
2
*
pi
*
t
)
ax1
=
subplot
(
211
)
plot
(
t
,
s
,
'-'
,
lw
=
2
)
xlabel
(
'xlabel for top axes'
)
ylabel
(
'ylabel on the right'
)
title
(
'About as simple as it gets, folks'
)
grid
(
True
)
ax1
.
yaxis
.
set_label_position
(
'right'
)
ax1
.
xaxis
.
set_ticklabels
([
'Monday'
,
'Tuesday'
,
'Wednesday'
,
'Thursday'
,
'Friday'
])
for
label
in
ax1
.
get_xticklabels
():
label
.
set_rotation
(
45
)
ax2
=
subplot
(
212
)
plot
(
t
,
s
,
'-'
,
lw
=
2
)
grid
(
True
)
xlabel
(
'xlabel for bottom axes (the ticks are on the top for no good reason)'
)
ylabel
(
'I
\'
m a lefty'
)
ax2
.
xaxis
.
set_label_position
(
'bottom'
)
ax2
.
xaxis
.
set_ticks_position
(
'top'
)
#savefig('simple_plot.png')
savefig
(
'simple_plot'
)
show
()
Back
|
FazBrowse Home
|
New Git URL