File: axis_equal_demo.py

package info (click to toggle)
matplotlib 1.1.1~rc2-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 66,076 kB
  • sloc: python: 90,600; cpp: 69,891; objc: 5,231; ansic: 1,723; makefile: 171; sh: 7
file content (36 lines) | stat: -rw-r--r-- 639 bytes parent folder | download | duplicates (9)
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
35
36
'''This example is only interesting when ran in interactive mode'''

from pylab import *

# Plot circle or radius 3

an = linspace(0,2*pi,100)

subplot(221)
plot( 3*cos(an), 3*sin(an) )
title('not equal, looks like ellipse',fontsize=10)

subplot(222)
plot( 3*cos(an), 3*sin(an) )
axis('equal')
title('equal, looks like circle',fontsize=10)

subplot(223)
plot( 3*cos(an), 3*sin(an) )
axis('equal')
axis([-3,3,-3,3])
title('looks like circle, even after changing limits',fontsize=10)

subplot(224)
plot( 3*cos(an), 3*sin(an) )
axis('equal')
axis([-3,3,-3,3])
plot([0,4],[0,4])
title('still equal after adding line',fontsize=10)

show()