From cbc42296dce9d199ef6f33ee6a893ebb11fbfac5 Mon Sep 17 00:00:00 2001 From: Ruth Comer <10599679+rcomer@users.noreply.github.com> Date: Wed, 21 Aug 2024 10:17:02 +0100 Subject: [PATCH 1/7] Backport PR #28739: Tweak interactivity docs wording (and fix capitalization). --- galleries/users_explain/figure/event_handling.rst | 15 +++++++++------ galleries/users_explain/figure/interactive.rst | 2 +- .../users_explain/figure/interactive_guide.rst | 2 +- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/galleries/users_explain/figure/event_handling.rst b/galleries/users_explain/figure/event_handling.rst index 49d73afeb366..32da038634ae 100644 --- a/galleries/users_explain/figure/event_handling.rst +++ b/galleries/users_explain/figure/event_handling.rst @@ -251,7 +251,8 @@ is created every time a mouse is pressed:: def __call__(self, event): print('click', event) - if event.inaxes!=self.line.axes: return + if event.inaxes != self.line.axes: + return self.xs.append(event.xdata) self.ys.append(event.ydata) self.line.set_data(self.xs, self.ys) @@ -277,17 +278,19 @@ event.ydata)``. In addition to the ``LocationEvent`` attributes, it also has: Draggable rectangle exercise ---------------------------- -Write draggable rectangle class that is initialized with a +Write a draggable rectangle class that is initialized with a `.Rectangle` instance but will move its ``xy`` -location when dragged. Hint: you will need to store the original -``xy`` location of the rectangle which is stored as rect.xy and +location when dragged. + +Hint: You will need to store the original +``xy`` location of the rectangle which is stored as ``rect.xy`` and connect to the press, motion and release mouse events. When the mouse is pressed, check to see if the click occurs over your rectangle (see `.Rectangle.contains`) and if it does, store -the rectangle xy and the location of the mouse click in data coords. +the rectangle xy and the location of the mouse click in data coordinates. In the motion event callback, compute the deltax and deltay of the mouse movement, and add those deltas to the origin of the rectangle -you stored. The redraw the figure. On the button release event, just +you stored, then redraw the figure. On the button release event, just reset all the button press data you stored as None. Here is the solution:: diff --git a/galleries/users_explain/figure/interactive.rst b/galleries/users_explain/figure/interactive.rst index 6fd908fcac7a..b06283152e50 100644 --- a/galleries/users_explain/figure/interactive.rst +++ b/galleries/users_explain/figure/interactive.rst @@ -10,7 +10,7 @@ Interactive figures =================== -When working with data, interactivity can be invaluable. The pan/zoom and +Interactivity can be invaluable when exploring plots. The pan/zoom and mouse-location tools built into the Matplotlib GUI windows are often sufficient, but you can also use the event system to build customized data exploration tools. diff --git a/galleries/users_explain/figure/interactive_guide.rst b/galleries/users_explain/figure/interactive_guide.rst index 3b6f527f6d42..b08231e84f7e 100644 --- a/galleries/users_explain/figure/interactive_guide.rst +++ b/galleries/users_explain/figure/interactive_guide.rst @@ -236,7 +236,7 @@ which would poll for new data and update the figure at 1Hz. .. _spin_event_loop: -Explicitly spinning the event Loop +Explicitly spinning the event loop ---------------------------------- .. autosummary:: From cf7e7ae718ced0a8b2bbf7aa2d30b141fa5eeb8c Mon Sep 17 00:00:00 2001 From: Ruth Comer <10599679+rcomer@users.noreply.github.com> Date: Sun, 8 Sep 2024 08:44:57 +0100 Subject: [PATCH 2/7] Backport PR #28790: DOC: Fix duplicate Figure.set_dpi entry --- doc/api/figure_api.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/api/figure_api.rst b/doc/api/figure_api.rst index 2371e5a9a863..5dd3adbfec9f 100644 --- a/doc/api/figure_api.rst +++ b/doc/api/figure_api.rst @@ -91,7 +91,7 @@ Figure geometry Figure.get_figwidth Figure.dpi Figure.set_dpi - Figure.set_dpi + Figure.get_dpi Subplot layout -------------- From 259b3ee84784341b50696206d559f67c74ba9c89 Mon Sep 17 00:00:00 2001 From: Thomas A Caswell Date: Wed, 11 Sep 2024 16:54:17 -0400 Subject: [PATCH 3/7] Backport PR #28798: DOC: Correctly list modules that have been internalized --- doc/api/_afm_api.rst | 8 ++++++++ doc/api/_docstring_api.rst | 8 ++++++++ doc/api/_tight_bbox_api.rst | 8 ++++++++ doc/api/_tight_layout_api.rst | 8 ++++++++ doc/api/_type1font.rst | 8 ++++++++ doc/api/afm_api.rst | 13 ------------- doc/api/docstring_api.rst | 13 ------------- doc/api/index.rst | 10 +++++----- doc/api/tight_bbox_api.rst | 13 ------------- doc/api/tight_layout_api.rst | 13 ------------- doc/api/type1font.rst | 13 ------------- 11 files changed, 45 insertions(+), 70 deletions(-) create mode 100644 doc/api/_afm_api.rst create mode 100644 doc/api/_docstring_api.rst create mode 100644 doc/api/_tight_bbox_api.rst create mode 100644 doc/api/_tight_layout_api.rst create mode 100644 doc/api/_type1font.rst delete mode 100644 doc/api/afm_api.rst delete mode 100644 doc/api/docstring_api.rst delete mode 100644 doc/api/tight_bbox_api.rst delete mode 100644 doc/api/tight_layout_api.rst delete mode 100644 doc/api/type1font.rst diff --git a/doc/api/_afm_api.rst b/doc/api/_afm_api.rst new file mode 100644 index 000000000000..4e2ac4997272 --- /dev/null +++ b/doc/api/_afm_api.rst @@ -0,0 +1,8 @@ +******************* +``matplotlib._afm`` +******************* + +.. automodule:: matplotlib._afm + :members: + :undoc-members: + :show-inheritance: diff --git a/doc/api/_docstring_api.rst b/doc/api/_docstring_api.rst new file mode 100644 index 000000000000..040a3653a87b --- /dev/null +++ b/doc/api/_docstring_api.rst @@ -0,0 +1,8 @@ +************************* +``matplotlib._docstring`` +************************* + +.. automodule:: matplotlib._docstring + :members: + :undoc-members: + :show-inheritance: diff --git a/doc/api/_tight_bbox_api.rst b/doc/api/_tight_bbox_api.rst new file mode 100644 index 000000000000..826e051fcf6d --- /dev/null +++ b/doc/api/_tight_bbox_api.rst @@ -0,0 +1,8 @@ +************************** +``matplotlib._tight_bbox`` +************************** + +.. automodule:: matplotlib._tight_bbox + :members: + :undoc-members: + :show-inheritance: diff --git a/doc/api/_tight_layout_api.rst b/doc/api/_tight_layout_api.rst new file mode 100644 index 000000000000..ac4f66f280e1 --- /dev/null +++ b/doc/api/_tight_layout_api.rst @@ -0,0 +1,8 @@ +**************************** +``matplotlib._tight_layout`` +**************************** + +.. automodule:: matplotlib._tight_layout + :members: + :undoc-members: + :show-inheritance: diff --git a/doc/api/_type1font.rst b/doc/api/_type1font.rst new file mode 100644 index 000000000000..1a9ff2292887 --- /dev/null +++ b/doc/api/_type1font.rst @@ -0,0 +1,8 @@ +************************* +``matplotlib._type1font`` +************************* + +.. automodule:: matplotlib._type1font + :members: + :undoc-members: + :show-inheritance: diff --git a/doc/api/afm_api.rst b/doc/api/afm_api.rst deleted file mode 100644 index bcae04150909..000000000000 --- a/doc/api/afm_api.rst +++ /dev/null @@ -1,13 +0,0 @@ -****************** -``matplotlib.afm`` -****************** - -.. attention:: - This module is considered internal. - - Its use is deprecated and it will be removed in a future version. - -.. automodule:: matplotlib._afm - :members: - :undoc-members: - :show-inheritance: diff --git a/doc/api/docstring_api.rst b/doc/api/docstring_api.rst deleted file mode 100644 index 38a73a2e83d1..000000000000 --- a/doc/api/docstring_api.rst +++ /dev/null @@ -1,13 +0,0 @@ -************************ -``matplotlib.docstring`` -************************ - -.. attention:: - This module is considered internal. - - Its use is deprecated and it will be removed in a future version. - -.. automodule:: matplotlib._docstring - :members: - :undoc-members: - :show-inheritance: diff --git a/doc/api/index.rst b/doc/api/index.rst index 70c3b5343e7a..53f397a6817a 100644 --- a/doc/api/index.rst +++ b/doc/api/index.rst @@ -79,7 +79,6 @@ Alphabetical list of modules: :maxdepth: 1 matplotlib_configuration_api.rst - afm_api.rst animation_api.rst artist_api.rst axes_api.rst @@ -98,7 +97,6 @@ Alphabetical list of modules: container_api.rst contour_api.rst dates_api.rst - docstring_api.rst dviread.rst figure_api.rst font_manager_api.rst @@ -134,16 +132,18 @@ Alphabetical list of modules: text_api.rst texmanager_api.rst ticker_api.rst - tight_bbox_api.rst - tight_layout_api.rst transformations.rst tri_api.rst - type1font.rst typing_api.rst units_api.rst widgets_api.rst + _afm_api.rst _api_api.rst + _docstring_api.rst _enums_api.rst + _type1font.rst + _tight_bbox_api.rst + _tight_layout_api.rst toolkits/mplot3d.rst toolkits/axes_grid1.rst toolkits/axisartist.rst diff --git a/doc/api/tight_bbox_api.rst b/doc/api/tight_bbox_api.rst deleted file mode 100644 index 9e8dd2fa66f9..000000000000 --- a/doc/api/tight_bbox_api.rst +++ /dev/null @@ -1,13 +0,0 @@ -************************* -``matplotlib.tight_bbox`` -************************* - -.. attention:: - This module is considered internal. - - Its use is deprecated and it will be removed in a future version. - -.. automodule:: matplotlib._tight_bbox - :members: - :undoc-members: - :show-inheritance: diff --git a/doc/api/tight_layout_api.rst b/doc/api/tight_layout_api.rst deleted file mode 100644 index 35f92e3ddced..000000000000 --- a/doc/api/tight_layout_api.rst +++ /dev/null @@ -1,13 +0,0 @@ -*************************** -``matplotlib.tight_layout`` -*************************** - -.. attention:: - This module is considered internal. - - Its use is deprecated and it will be removed in a future version. - -.. automodule:: matplotlib._tight_layout - :members: - :undoc-members: - :show-inheritance: diff --git a/doc/api/type1font.rst b/doc/api/type1font.rst deleted file mode 100644 index 00ef38f4d447..000000000000 --- a/doc/api/type1font.rst +++ /dev/null @@ -1,13 +0,0 @@ -************************ -``matplotlib.type1font`` -************************ - -.. attention:: - This module is considered internal. - - Its use is deprecated and it will be removed in a future version. - -.. automodule:: matplotlib._type1font - :members: - :undoc-members: - :show-inheritance: From 96654d64dfea78901c9d912aca62c47fd4fb287c Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Thu, 12 Sep 2024 05:28:44 -0400 Subject: [PATCH 4/7] Backport PR #28805: add brackets to satisfy the new sequence requirement --- galleries/examples/animation/frame_grabbing_sgskip.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/galleries/examples/animation/frame_grabbing_sgskip.py b/galleries/examples/animation/frame_grabbing_sgskip.py index 08155d2c61a7..dcc2ca01afd9 100644 --- a/galleries/examples/animation/frame_grabbing_sgskip.py +++ b/galleries/examples/animation/frame_grabbing_sgskip.py @@ -6,8 +6,6 @@ Use a MovieWriter directly to grab individual frames and write them to a file. This avoids any event loop integration, and thus works even with the Agg backend. This is not recommended for use in an interactive setting. - -Output generated via `matplotlib.animation.Animation.to_jshtml`. """ import numpy as np @@ -39,5 +37,5 @@ for i in range(100): x0 += 0.1 * np.random.randn() y0 += 0.1 * np.random.randn() - l.set_data(x0, y0) + l.set_data([x0], [y0]) writer.grab_frame() From a058fae22f55154bd4080b41a5d9b096e8e96d1d Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Thu, 12 Sep 2024 19:05:23 -0400 Subject: [PATCH 5/7] Backport PR #28810: Document how to obtain sans-serif usetex math. --- galleries/users_explain/text/usetex.py | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/galleries/users_explain/text/usetex.py b/galleries/users_explain/text/usetex.py index 0194a0030d48..f0c266819897 100644 --- a/galleries/users_explain/text/usetex.py +++ b/galleries/users_explain/text/usetex.py @@ -102,6 +102,12 @@ :rc:`text.usetex`. As noted above, underscores (``_``) do not require escaping outside of math mode. +.. note:: + LaTeX always defaults to using a serif font for math (even when + ``rcParams["font.family"] = "sans-serif"``). If desired, adding + ``\usepackage{sfmath}`` to ``rcParams["text.latex.preamble"]`` lets LaTeX + output sans-serif math. + PostScript options ================== @@ -129,19 +135,13 @@ :ref:`setting-windows-environment-variables` for details. * Using MiKTeX with Computer Modern fonts, if you get odd \*Agg and PNG - results, go to MiKTeX/Options and update your format files + results, go to MiKTeX/Options and update your format files. * On Ubuntu and Gentoo, the base texlive install does not ship with the type1cm package. You may need to install some of the extra packages to get all the goodies that come bundled with other LaTeX distributions. -* Some progress has been made so Matplotlib uses the dvi files - directly for text layout. This allows LaTeX to be used for text - layout with the pdf and svg backends, as well as the \*Agg and PS - backends. In the future, a LaTeX installation may be the only - external dependency. - .. _usetex-troubleshooting: Troubleshooting @@ -150,7 +150,7 @@ * Try deleting your :file:`.matplotlib/tex.cache` directory. If you don't know where to find :file:`.matplotlib`, see :ref:`locating-matplotlib-config-dir`. -* Make sure LaTeX, dvipng and ghostscript are each working and on your +* Make sure LaTeX, dvipng and Ghostscript are each working and on your :envvar:`PATH`. * Make sure what you are trying to do is possible in a LaTeX document, @@ -159,8 +159,7 @@ * :rc:`text.latex.preamble` is not officially supported. This option provides lots of flexibility, and lots of ways to cause - problems. Please disable this option before reporting problems to - the mailing list. + problems. Please disable this option before reporting problems. * If you still need help, please see :ref:`reporting-problems`. From af21823d513c6c01d9b8037fa6c2e68ab90fedfe Mon Sep 17 00:00:00 2001 From: hannah Date: Mon, 28 Oct 2024 18:49:26 -0400 Subject: [PATCH 6/7] Backport PR #27569: DOC: initial tags for statistics section of gallery --- galleries/examples/statistics/boxplot.py | 2 ++ galleries/examples/statistics/boxplot_color.py | 2 ++ galleries/examples/statistics/boxplot_demo.py | 2 ++ galleries/examples/statistics/boxplot_vs_violin.py | 2 ++ galleries/examples/statistics/bxp.py | 2 ++ galleries/examples/statistics/confidence_ellipse.py | 8 ++++++++ galleries/examples/statistics/customized_violin.py | 2 ++ galleries/examples/statistics/errorbar.py | 3 +++ galleries/examples/statistics/errorbar_features.py | 2 ++ galleries/examples/statistics/errorbar_limits.py | 2 ++ galleries/examples/statistics/errorbars_and_boxes.py | 8 ++++++++ galleries/examples/statistics/hexbin_demo.py | 2 ++ galleries/examples/statistics/hist.py | 9 +++++++++ galleries/examples/statistics/histogram_bihistogram.py | 4 ++++ galleries/examples/statistics/histogram_cumulative.py | 2 ++ galleries/examples/statistics/histogram_histtypes.py | 2 ++ galleries/examples/statistics/histogram_multihist.py | 2 ++ galleries/examples/statistics/histogram_normalization.py | 2 ++ .../statistics/multiple_histograms_side_by_side.py | 7 +++++++ galleries/examples/statistics/time_series_histogram.py | 8 ++++++++ galleries/examples/statistics/violinplot.py | 2 ++ 21 files changed, 75 insertions(+) diff --git a/galleries/examples/statistics/boxplot.py b/galleries/examples/statistics/boxplot.py index ccdaab97d24a..6d30cbd4b5f0 100644 --- a/galleries/examples/statistics/boxplot.py +++ b/galleries/examples/statistics/boxplot.py @@ -97,6 +97,8 @@ # %% # +# .. tags:: plot-type: boxplot, domain: statistics +# # .. admonition:: References # # The use of the following functions, methods, classes and modules is shown diff --git a/galleries/examples/statistics/boxplot_color.py b/galleries/examples/statistics/boxplot_color.py index 3491253aaf3e..acdb37d7d520 100644 --- a/galleries/examples/statistics/boxplot_color.py +++ b/galleries/examples/statistics/boxplot_color.py @@ -36,6 +36,8 @@ # %% # +# .. tags:: styling: color, domain: statistics, plot-type: boxplot +# # .. admonition:: References # # The use of the following functions, methods, classes and modules is shown diff --git a/galleries/examples/statistics/boxplot_demo.py b/galleries/examples/statistics/boxplot_demo.py index eca0e152078e..ec23408c0bfc 100644 --- a/galleries/examples/statistics/boxplot_demo.py +++ b/galleries/examples/statistics/boxplot_demo.py @@ -247,6 +247,8 @@ def fake_bootstrapper(n): # %% # +# .. tags:: domain: statistics, plot-type: boxplot +# # .. admonition:: References # # The use of the following functions, methods, classes and modules is shown diff --git a/galleries/examples/statistics/boxplot_vs_violin.py b/galleries/examples/statistics/boxplot_vs_violin.py index dce8912013b0..f277e737e65c 100644 --- a/galleries/examples/statistics/boxplot_vs_violin.py +++ b/galleries/examples/statistics/boxplot_vs_violin.py @@ -54,6 +54,8 @@ # %% # +# .. tags:: plot-type: violin, plot-type: boxplot, domain: statistics +# # .. admonition:: References # # The use of the following functions, methods, classes and modules is shown diff --git a/galleries/examples/statistics/bxp.py b/galleries/examples/statistics/bxp.py index b12bfebd16cc..3ddd164df742 100644 --- a/galleries/examples/statistics/bxp.py +++ b/galleries/examples/statistics/bxp.py @@ -64,6 +64,8 @@ # %% # +# .. tags:: plot-type: speciality, domain: statistics +# # .. admonition:: References # # The use of the following functions, methods, classes and modules is shown diff --git a/galleries/examples/statistics/confidence_ellipse.py b/galleries/examples/statistics/confidence_ellipse.py index 27b06146a44e..4ac0917f4bda 100644 --- a/galleries/examples/statistics/confidence_ellipse.py +++ b/galleries/examples/statistics/confidence_ellipse.py @@ -217,6 +217,14 @@ def get_correlated_dataset(n, dependency, mu, scale): # %% # +# .. tags:: +# +# plot-type: speciality +# plot-type: scatter +# component: ellipse +# component: patch +# domain: statistics +# # .. admonition:: References # # The use of the following functions, methods, classes and modules is shown diff --git a/galleries/examples/statistics/customized_violin.py b/galleries/examples/statistics/customized_violin.py index c1d2e432ca2e..29ddcda92fbe 100644 --- a/galleries/examples/statistics/customized_violin.py +++ b/galleries/examples/statistics/customized_violin.py @@ -73,6 +73,8 @@ def set_axis_style(ax, labels): # %% # +# .. tags:: plot-type: violin, domain: statistics +# # .. admonition:: References # # The use of the following functions, methods, classes and modules is shown diff --git a/galleries/examples/statistics/errorbar.py b/galleries/examples/statistics/errorbar.py index a25cadf88211..019590dc3f32 100644 --- a/galleries/examples/statistics/errorbar.py +++ b/galleries/examples/statistics/errorbar.py @@ -21,6 +21,9 @@ # %% # +# +# .. tags:: plot-type: errorbar, domain: statistics, +# # .. admonition:: References # # The use of the following functions, methods, classes and modules is shown diff --git a/galleries/examples/statistics/errorbar_features.py b/galleries/examples/statistics/errorbar_features.py index 349cc89ff2e0..8abaffcda537 100644 --- a/galleries/examples/statistics/errorbar_features.py +++ b/galleries/examples/statistics/errorbar_features.py @@ -48,6 +48,8 @@ # %% # +# .. tags:: plot-type: errorbar, domain: statistics +# # .. admonition:: References # # The use of the following functions, methods, classes and modules is shown diff --git a/galleries/examples/statistics/errorbar_limits.py b/galleries/examples/statistics/errorbar_limits.py index d5b0e476d894..f1d26460d947 100644 --- a/galleries/examples/statistics/errorbar_limits.py +++ b/galleries/examples/statistics/errorbar_limits.py @@ -77,6 +77,8 @@ # %% # +# .. tags:: plot-type: errorbar, domain: statistics +# # .. admonition:: References # # The use of the following functions, methods, classes and modules is shown diff --git a/galleries/examples/statistics/errorbars_and_boxes.py b/galleries/examples/statistics/errorbars_and_boxes.py index 54c8786096c7..b45eee751137 100644 --- a/galleries/examples/statistics/errorbars_and_boxes.py +++ b/galleries/examples/statistics/errorbars_and_boxes.py @@ -71,6 +71,14 @@ def make_error_boxes(ax, xdata, ydata, xerror, yerror, facecolor='r', # %% # +# +# .. tags:: +# +# plot-type: errorbar +# component: rectangle +# component: patchcollection +# domain: statistics +# # .. admonition:: References # # The use of the following functions, methods, classes and modules is shown diff --git a/galleries/examples/statistics/hexbin_demo.py b/galleries/examples/statistics/hexbin_demo.py index b9a6206a934f..bd1522772aae 100644 --- a/galleries/examples/statistics/hexbin_demo.py +++ b/galleries/examples/statistics/hexbin_demo.py @@ -35,6 +35,8 @@ # %% # +# .. tags:: plot-type: histogram, plot-type: hexbin, domain: statistics +# # .. admonition:: References # # The use of the following functions, methods, classes and modules is shown diff --git a/galleries/examples/statistics/hist.py b/galleries/examples/statistics/hist.py index 8b06093913df..e31aca0228c2 100644 --- a/galleries/examples/statistics/hist.py +++ b/galleries/examples/statistics/hist.py @@ -103,6 +103,15 @@ # %% # +# .. tags:: +# +# plot-type: histogram, +# plot-type: histogram2d +# domain: statistics +# styling: color, +# component: normalization +# component: patch +# # .. admonition:: References # # The use of the following functions, methods, classes and modules is shown diff --git a/galleries/examples/statistics/histogram_bihistogram.py b/galleries/examples/statistics/histogram_bihistogram.py index 7bfae14e9285..73f549493438 100644 --- a/galleries/examples/statistics/histogram_bihistogram.py +++ b/galleries/examples/statistics/histogram_bihistogram.py @@ -43,3 +43,7 @@ ax.legend() plt.show() + +# %% +# +# .. tags:: plot-type: histogram, domain: statistics, purpose: showcase diff --git a/galleries/examples/statistics/histogram_cumulative.py b/galleries/examples/statistics/histogram_cumulative.py index 9ce16568d126..d87305629f8d 100644 --- a/galleries/examples/statistics/histogram_cumulative.py +++ b/galleries/examples/statistics/histogram_cumulative.py @@ -67,6 +67,8 @@ # %% # +# .. tags:: plot-type: ecdf, plot-type: histogram, domain: statistics +# # .. admonition:: References # # The use of the following functions, methods, classes and modules is shown diff --git a/galleries/examples/statistics/histogram_histtypes.py b/galleries/examples/statistics/histogram_histtypes.py index 0188d7bf5d0f..53d6425cf4dc 100644 --- a/galleries/examples/statistics/histogram_histtypes.py +++ b/galleries/examples/statistics/histogram_histtypes.py @@ -51,6 +51,8 @@ # %% # +# .. tags:: plot-type: histogram, domain: statistics, purpose: reference +# # .. admonition:: References # # The use of the following functions, methods, classes and modules is shown diff --git a/galleries/examples/statistics/histogram_multihist.py b/galleries/examples/statistics/histogram_multihist.py index f1957dc38939..78ff03719057 100644 --- a/galleries/examples/statistics/histogram_multihist.py +++ b/galleries/examples/statistics/histogram_multihist.py @@ -47,6 +47,8 @@ # %% # +# .. tags:: plot-type: histogram, domain: statistics, purpose: reference +# # .. admonition:: References # # The use of the following functions, methods, classes and modules is shown diff --git a/galleries/examples/statistics/histogram_normalization.py b/galleries/examples/statistics/histogram_normalization.py index 9418b7af002b..2c423edad208 100644 --- a/galleries/examples/statistics/histogram_normalization.py +++ b/galleries/examples/statistics/histogram_normalization.py @@ -243,6 +243,8 @@ # %% # +# .. tags:: plot-type: histogram, domain: statistics +# # .. admonition:: References # # The use of the following functions, methods, classes and modules is shown diff --git a/galleries/examples/statistics/multiple_histograms_side_by_side.py b/galleries/examples/statistics/multiple_histograms_side_by_side.py index 3c5766f8e546..733aed51f253 100644 --- a/galleries/examples/statistics/multiple_histograms_side_by_side.py +++ b/galleries/examples/statistics/multiple_histograms_side_by_side.py @@ -63,6 +63,13 @@ # %% # +# .. tags:: +# +# domain: statistics +# plot-type: barh +# plot-type: histogram +# styling: position +# # .. admonition:: References # # The use of the following functions, methods, classes and modules is shown diff --git a/galleries/examples/statistics/time_series_histogram.py b/galleries/examples/statistics/time_series_histogram.py index 371d182915b8..6f9a543fb4e5 100644 --- a/galleries/examples/statistics/time_series_histogram.py +++ b/galleries/examples/statistics/time_series_histogram.py @@ -94,6 +94,14 @@ # %% # +# .. tags:: +# +# plot-type: histogram2d +# plot-type: pcolormesh +# purpose: storytelling +# styling: color +# component: colormap +# # .. admonition:: References # # The use of the following functions, methods, classes and modules is shown diff --git a/galleries/examples/statistics/violinplot.py b/galleries/examples/statistics/violinplot.py index afcc1c977034..3d0d44538032 100644 --- a/galleries/examples/statistics/violinplot.py +++ b/galleries/examples/statistics/violinplot.py @@ -106,6 +106,8 @@ # %% # +# .. tags:: plot-type: violin, domain: statistics +# # .. admonition:: References # # The use of the following functions, methods, classes and modules is shown From 9b1b45bf8bb30609f7155305000b4aebbc61ec39 Mon Sep 17 00:00:00 2001 From: Tim Hoffmann <2836374+timhoffm@users.noreply.github.com> Date: Tue, 29 Oct 2024 10:56:09 +0100 Subject: [PATCH 7/7] Backport PR #29036: Don't pass redundant inline=True to example clabel() calls. --- .../images_contours_and_fields/contour_demo.py | 12 ++++++------ .../images_contours_and_fields/contour_label_demo.py | 4 ++-- galleries/examples/misc/demo_agg_filter.py | 1 - 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/galleries/examples/images_contours_and_fields/contour_demo.py b/galleries/examples/images_contours_and_fields/contour_demo.py index 1d64986850f5..885a8a3c2005 100644 --- a/galleries/examples/images_contours_and_fields/contour_demo.py +++ b/galleries/examples/images_contours_and_fields/contour_demo.py @@ -30,7 +30,7 @@ fig, ax = plt.subplots() CS = ax.contour(X, Y, Z) -ax.clabel(CS, inline=True, fontsize=10) +ax.clabel(CS, fontsize=10) ax.set_title('Simplest default with labels') # %% @@ -42,7 +42,7 @@ CS = ax.contour(X, Y, Z) manual_locations = [ (-1, -1.4), (-0.62, -0.7), (-2, 0.5), (1.7, 1.2), (2.0, 1.4), (2.4, 1.7)] -ax.clabel(CS, inline=True, fontsize=10, manual=manual_locations) +ax.clabel(CS, fontsize=10, manual=manual_locations) ax.set_title('labels at selected locations') # %% @@ -50,7 +50,7 @@ fig, ax = plt.subplots() CS = ax.contour(X, Y, Z, 6, colors='k') # Negative contours default to dashed. -ax.clabel(CS, fontsize=9, inline=True) +ax.clabel(CS, fontsize=9) ax.set_title('Single color - negative contours dashed') # %% @@ -59,7 +59,7 @@ plt.rcParams['contour.negative_linestyle'] = 'solid' fig, ax = plt.subplots() CS = ax.contour(X, Y, Z, 6, colors='k') # Negative contours default to dashed. -ax.clabel(CS, fontsize=9, inline=True) +ax.clabel(CS, fontsize=9) ax.set_title('Single color - negative contours solid') # %% @@ -70,7 +70,7 @@ linewidths=np.arange(.5, 4, .5), colors=('r', 'green', 'blue', (1, 1, 0), '#afeeee', '0.5'), ) -ax.clabel(CS, fontsize=9, inline=True) +ax.clabel(CS, fontsize=9) ax.set_title('Crazy lines') # %% @@ -90,7 +90,7 @@ CS.set_linewidth(lws) ax.clabel(CS, levels[1::2], # label every second level - inline=True, fmt='%1.1f', fontsize=14) + fmt='%1.1f', fontsize=14) # make a colorbar for the contour lines CB = fig.colorbar(CS, shrink=0.8) diff --git a/galleries/examples/images_contours_and_fields/contour_label_demo.py b/galleries/examples/images_contours_and_fields/contour_label_demo.py index 57f29c827757..0b24b57f6afd 100644 --- a/galleries/examples/images_contours_and_fields/contour_label_demo.py +++ b/galleries/examples/images_contours_and_fields/contour_label_demo.py @@ -43,7 +43,7 @@ def fmt(x): fig, ax = plt.subplots() CS = ax.contour(X, Y, Z) -ax.clabel(CS, CS.levels, inline=True, fmt=fmt, fontsize=10) +ax.clabel(CS, CS.levels, fmt=fmt, fontsize=10) # %% # Label contours with arbitrary strings using a dictionary @@ -59,7 +59,7 @@ def fmt(x): fmt[l] = s # Label every other level using strings -ax1.clabel(CS1, CS1.levels[::2], inline=True, fmt=fmt, fontsize=10) +ax1.clabel(CS1, CS1.levels[::2], fmt=fmt, fontsize=10) # %% # Use a Formatter diff --git a/galleries/examples/misc/demo_agg_filter.py b/galleries/examples/misc/demo_agg_filter.py index 5c2ad71a6673..302250ced9f0 100644 --- a/galleries/examples/misc/demo_agg_filter.py +++ b/galleries/examples/misc/demo_agg_filter.py @@ -188,7 +188,6 @@ def filtered_text(ax): # contour label cl = ax.clabel(CS, levels[1::2], # label every second level - inline=True, fmt='%1.1f', fontsize=11)