Skip to content

DOC: Clean up equal-aspect example #8258

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 1 commit into from
Mar 23, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
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
3 changes: 2 additions & 1 deletion doc/faq/howto_faq.rst
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,8 @@ some ratio which controls the ratio::

.. htmlonly::

See :ref:`pylab_examples-equal_aspect_ratio` for a complete example.
See :ref:`subplots_axes_and_figures-plot_equal_aspect_ratio` for a complete
example.


.. _howto-twoscale:
Expand Down
20 changes: 0 additions & 20 deletions examples/pylab_examples/equal_aspect_ratio.py

This file was deleted.

26 changes: 26 additions & 0 deletions examples/subplots_axes_and_figures/plot_equal_aspect_ratio.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
"""
=================
Equal aspect axes
=================

This example shows how to make a plot whose x and y axes have a 1:1 aspect
ratio.
"""
import matplotlib.pyplot as plt
import numpy as np

t = np.arange(0.0, 1.0 + 0.01, 0.01)
s = np.cos(2 * 2 * np.pi * t)

fig, ax = plt.subplots()
ax.plot(t, s, '-', lw=2)

ax.set_xlabel('Time (s)')
ax.set_ylabel('Voltage (mV)')
ax.set_title('About as simple as it gets, folks')
ax.grid(True)

ax.set_aspect('equal', 'datalim')

fig.tight_layout()
plt.show()