forked from matplotlib/matplotlib
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathauto_layout.py
More file actions
executable file
·34 lines (28 loc) · 832 Bytes
/
Copy pathauto_layout.py
File metadata and controls
executable file
·34 lines (28 loc) · 832 Bytes
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()