diff --git a/galleries/examples/subplots_axes_and_figures/gridspec_nested.py b/galleries/examples/subplots_axes_and_figures/gridspec_nested.py index 025bdb1185a7..789cc0ae6b5b 100644 --- a/galleries/examples/subplots_axes_and_figures/gridspec_nested.py +++ b/galleries/examples/subplots_axes_and_figures/gridspec_nested.py @@ -1,4 +1,6 @@ """ +.. redirect-from:: /gallery/userdemo/demo_gridspec06 + ================ Nested Gridspecs ================ diff --git a/galleries/examples/userdemo/README.txt b/galleries/examples/userdemo/README.txt deleted file mode 100644 index 7be351dc70dd..000000000000 --- a/galleries/examples/userdemo/README.txt +++ /dev/null @@ -1,4 +0,0 @@ -.. _userdemo: - -Userdemo -======== diff --git a/galleries/examples/userdemo/demo_gridspec06.py b/galleries/examples/userdemo/demo_gridspec06.py deleted file mode 100644 index c42224ce1e7b..000000000000 --- a/galleries/examples/userdemo/demo_gridspec06.py +++ /dev/null @@ -1,38 +0,0 @@ -r""" -================ -Nested GridSpecs -================ - -This example demonstrates the use of nested `.GridSpec`\s. -""" - -import matplotlib.pyplot as plt -import numpy as np - - -def squiggle_xy(a, b, c, d): - i = np.arange(0.0, 2*np.pi, 0.05) - return np.sin(i*a)*np.cos(i*b), np.sin(i*c)*np.cos(i*d) - - -fig = plt.figure(figsize=(8, 8)) -outer_grid = fig.add_gridspec(4, 4, wspace=0, hspace=0) - -for a in range(4): - for b in range(4): - # gridspec inside gridspec - inner_grid = outer_grid[a, b].subgridspec(3, 3, wspace=0, hspace=0) - axs = inner_grid.subplots() # Create all subplots for the inner grid. - for (c, d), ax in np.ndenumerate(axs): - ax.plot(*squiggle_xy(a + 1, b + 1, c + 1, d + 1)) - ax.set(xticks=[], yticks=[]) - -# show only the outside spines -for ax in fig.get_axes(): - ss = ax.get_subplotspec() - ax.spines.top.set_visible(ss.is_first_row()) - ax.spines.bottom.set_visible(ss.is_last_row()) - ax.spines.left.set_visible(ss.is_first_col()) - ax.spines.right.set_visible(ss.is_last_col()) - -plt.show() diff --git a/galleries/users_explain/axes/legend_guide.py b/galleries/users_explain/axes/legend_guide.py index 5da3ceafe387..ec0468fe172d 100644 --- a/galleries/users_explain/axes/legend_guide.py +++ b/galleries/users_explain/axes/legend_guide.py @@ -1,7 +1,7 @@ """ .. redirect-from:: /tutorials/intermediate/legend_guide -.. redirect-from:: /galleries/examples/userdemo/simple_legend01 -.. redirect-from:: /galleries/examples/userdemo/simple_legend02 +.. redirect-from:: /gallery/userdemo/simple_legend01 +.. redirect-from:: /gallery/userdemo/simple_legend02 .. _legend_guide: diff --git a/pyproject.toml b/pyproject.toml index 70b078a73d27..b980e512769a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -196,7 +196,6 @@ convention = "numpy" "galleries/examples/user_interfaces/mpl_with_glade3_sgskip.py" = ["E402"] "galleries/examples/user_interfaces/pylab_with_gtk3_sgskip.py" = ["E402"] "galleries/examples/user_interfaces/pylab_with_gtk4_sgskip.py" = ["E402"] -"galleries/examples/userdemo/pgf_preamble_sgskip.py" = ["E402"] "lib/matplotlib/__init__.py" = ["F822"] "lib/matplotlib/_cm.py" = ["E202", "E203", "E302"]