Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 777b9c9

Browse filesBrowse files
committed
Cleanup axes_demo.
1 parent 47cfa35 commit 777b9c9
Copy full SHA for 777b9c9

File tree

Expand file treeCollapse file tree

1 file changed

+6
-13
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+6
-13
lines changed

‎examples/subplots_axes_and_figures/axes_demo.py

Copy file name to clipboardExpand all lines: examples/subplots_axes_and_figures/axes_demo.py
+6-13Lines 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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.