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

Skip to content

Commit 69cd8bf

Browse files
authored
Merge pull request #16307 from anntzer/axes_demo
Cleanup axes_demo.
2 parents af4ab53 + 777b9c9 commit 69cd8bf

File tree

1 file changed

+6
-13
lines changed

1 file changed

+6
-13
lines changed

examples/subplots_axes_and_figures/axes_demo.py

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,14 @@
88
Please see also the :ref:`axes_grid_examples` section, and the following three
99
examples:
1010
11-
- :doc:`/gallery/subplots_axes_and_figures/zoom_inset_axes`
12-
- :doc:`/gallery/axes_grid1/inset_locator_demo`
13-
- :doc:`/gallery/axes_grid1/inset_locator_demo2`
11+
- :doc:`/gallery/subplots_axes_and_figures/zoom_inset_axes`
12+
- :doc:`/gallery/axes_grid1/inset_locator_demo`
13+
- :doc:`/gallery/axes_grid1/inset_locator_demo2`
1414
"""
1515
import matplotlib.pyplot as plt
1616
import numpy as np
1717

18-
# Fixing random state for reproducibility
19-
np.random.seed(19680801)
20-
18+
np.random.seed(19680801) # Fixing random state for reproducibility.
2119

2220
# create some data to use for the plot
2321
dt = 0.001
@@ -37,16 +35,11 @@
3735
# this is an inset axes over the main axes
3836
right_inset_ax = fig.add_axes([.65, .6, .2, .2], facecolor='k')
3937
right_inset_ax.hist(s, 400, density=True)
40-
right_inset_ax.set_title('Probability')
41-
right_inset_ax.set_xticks([])
42-
right_inset_ax.set_yticks([])
38+
right_inset_ax.set(title='Probability', xticks=[], yticks=[])
4339

4440
# this is another inset axes over the main axes
4541
left_inset_ax = fig.add_axes([.2, .6, .2, .2], facecolor='k')
4642
left_inset_ax.plot(t[:len(r)], r)
47-
left_inset_ax.set_title('Impulse response')
48-
left_inset_ax.set_xlim(0, 0.2)
49-
left_inset_ax.set_xticks([])
50-
left_inset_ax.set_yticks([])
43+
left_inset_ax.set(title='Impulse response', xlim=(0, .2), xticks=[], yticks=[])
5144

5245
plt.show()

0 commit comments

Comments
 (0)