Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ab29b9a

Browse files
committed
added axis equal demo
svn path=/trunk/matplotlib/; revision=1630
1 parent 5756b34 commit ab29b9a

1 file changed

Lines changed: 36 additions & 0 deletions

File tree

examples/axis_equal_demo.py

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
'''This example is only interesting when ran in interactive mode'''
2+
3+
from pylab import *
4+
5+
# Plot circle or radius 3
6+
7+
an = linspace(0,2*pi,100)
8+
9+
subplot(221)
10+
plot( 3*cos(an), 3*sin(an) )
11+
title('not equal, looks like ellipse',fontsize=10)
12+
13+
subplot(222)
14+
plot( 3*cos(an), 3*sin(an) )
15+
axis('equal')
16+
title('equal, looks like circle',fontsize=10)
17+
18+
subplot(223)
19+
plot( 3*cos(an), 3*sin(an) )
20+
axis('equal')
21+
axis([-3,3,-3,3])
22+
title('looks like circle, even after changing limits',fontsize=10)
23+
24+
subplot(224)
25+
plot( 3*cos(an), 3*sin(an) )
26+
axis('equal')
27+
axis([-3,3,-3,3])
28+
plot([0,4],[0,4])
29+
title('still equal after adding line',fontsize=10)
30+
31+
show()
32+
33+
34+
35+
36+

0 commit comments

Comments
 (0)