8000 MEP12 on axis_equal_demo.py by domspad · Pull Request #4664 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

MEP12 on axis_equal_demo.py #4664

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 19, 2015
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
pylab to plt and np
  • Loading branch information
domspad committed Jul 11, 2015
commit a0665f76c5d6e08cda87211a9c5e5e1e98d01648
43 changes: 22 additions & 21 deletions examples/pylab_examples/axis_equal_demo.py
Original file line number Diff line number Diff line change
@@ -1,31 +1,32 @@
'''This example is only interesting when ran in interactive mode'''

from pylab import *
import matplotlib.pyplot as plt
import numpy as np

# Plot circle or radius 3

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

subplot(221)
plot(3*cos(an), 3*sin(an))
title('not equal, looks like ellipse', fontsize=10)
plt.subplot(221)
plt.plot(3*np.cos(an), 3*np.sin(an))
plt.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)
plt.subplot(222)
plt.plot(3*np.cos(an), 3*np.sin(an))
plt.axis('equal')
plt.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)
plt.subplot(223)
plt.plot(3*np.cos(an), 3*np.sin(an))
plt.axis('equal')
plt.axis([-3, 3, -3, 3])
plt.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)
plt.subplot(224)
plt.plot(3*np.cos(an), 3*np.sin(an))
plt.axis('equal')
plt.axis([-3, 3, -3, 3])
plt.plot([0, 4], [0, 4])
plt.title('still equal after adding line', fontsize=10)

show()
plt.show()
0