From 3b85ba4365c8eaa172d0a92c9d3ecc2d51693c42 Mon Sep 17 00:00:00 2001 From: Kyle Sunden Date: Fri, 9 May 2025 12:23:58 -0500 Subject: [PATCH 01/11] Zenodo v3.10.3 --- doc/_static/zenodo_cache/14940554.svg | 35 +++++++++++++++++++++++++++ doc/_static/zenodo_cache/15375714.svg | 35 +++++++++++++++++++++++++++ doc/project/citing.rst | 6 +++++ tools/cache_zenodo_svg.py | 2 ++ 4 files changed, 78 insertions(+) create mode 100644 doc/_static/zenodo_cache/14940554.svg create mode 100644 doc/_static/zenodo_cache/15375714.svg diff --git a/doc/_static/zenodo_cache/14940554.svg b/doc/_static/zenodo_cache/14940554.svg new file mode 100644 index 000000000000..6e7d5c37bf7b --- /dev/null +++ b/doc/_static/zenodo_cache/14940554.svg @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + DOI + + + DOI + + + 10.5281/zenodo.14940554 + + + 10.5281/zenodo.14940554 + + + \ No newline at end of file diff --git a/doc/_static/zenodo_cache/15375714.svg b/doc/_static/zenodo_cache/15375714.svg new file mode 100644 index 000000000000..d5e403138561 --- /dev/null +++ b/doc/_static/zenodo_cache/15375714.svg @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + DOI + + + DOI + + + 10.5281/zenodo.15375714 + + + 10.5281/zenodo.15375714 + + + \ No newline at end of file diff --git a/doc/project/citing.rst b/doc/project/citing.rst index 2cd317906bb5..8b4c323229ca 100644 --- a/doc/project/citing.rst +++ b/doc/project/citing.rst @@ -32,6 +32,12 @@ By version .. START OF AUTOGENERATED +v3.10.3 + .. image:: ../_static/zenodo_cache/15375714.svg + :target: https://doi.org/10.5281/zenodo.15375714 +v3.10.1 + .. image:: ../_static/zenodo_cache/14940554.svg + :target: https://doi.org/10.5281/zenodo.14940554 v3.10.0 .. image:: ../_static/zenodo_cache/14464227.svg :target: https://doi.org/10.5281/zenodo.14464227 diff --git a/tools/cache_zenodo_svg.py b/tools/cache_zenodo_svg.py index 3be7d6ca21e4..229e90efeb34 100644 --- a/tools/cache_zenodo_svg.py +++ b/tools/cache_zenodo_svg.py @@ -63,6 +63,8 @@ def _get_xdg_cache_dir(): if __name__ == "__main__": data = { + "v3.10.3": "15375714", + "v3.10.1": "14940554", "v3.10.0": "14464227", "v3.9.4": "14436121", "v3.9.3": "14249941", From d3c77afde1e3fd6948d15ae730d0cebfe25fd6fe Mon Sep 17 00:00:00 2001 From: Tim Hoffmann <2836374+timhoffm@users.noreply.github.com> Date: Fri, 9 May 2025 22:46:21 +0200 Subject: [PATCH 02/11] Backport PR #30029: Update diagram in subplots_adjust documentation to clarify parameters --- doc/_embedded_plots/figure_subplots_adjust.py | 38 +++++++++++-------- 1 file changed, 22 insertions(+), 16 deletions(-) diff --git a/doc/_embedded_plots/figure_subplots_adjust.py b/doc/_embedded_plots/figure_subplots_adjust.py index b4b8d7d32a3d..6f99a3febcdc 100644 --- a/doc/_embedded_plots/figure_subplots_adjust.py +++ b/doc/_embedded_plots/figure_subplots_adjust.py @@ -1,28 +1,34 @@ import matplotlib.pyplot as plt -def arrow(p1, p2, **props): - axs[0, 0].annotate( - "", p1, p2, xycoords='figure fraction', - arrowprops=dict(arrowstyle="<->", shrinkA=0, shrinkB=0, **props)) - - fig, axs = plt.subplots(2, 2, figsize=(6.5, 4)) fig.set_facecolor('lightblue') fig.subplots_adjust(0.1, 0.1, 0.9, 0.9, 0.4, 0.4) + +overlay = fig.add_axes([0, 0, 1, 1], zorder=100) +overlay.axis("off") +xycoords='figure fraction' +arrowprops=dict(arrowstyle="<->", shrinkA=0, shrinkB=0) + for ax in axs.flat: ax.set(xticks=[], yticks=[]) -arrow((0, 0.75), (0.1, 0.75)) # left -arrow((0.435, 0.75), (0.565, 0.75)) # wspace -arrow((0.9, 0.75), (1, 0.75)) # right +overlay.annotate("", (0, 0.75), (0.1, 0.75), + xycoords=xycoords, arrowprops=arrowprops) # left +overlay.annotate("", (0.435, 0.25), (0.565, 0.25), + xycoords=xycoords, arrowprops=arrowprops) # wspace +overlay.annotate("", (0, 0.8), (0.9, 0.8), + xycoords=xycoords, arrowprops=arrowprops) # right fig.text(0.05, 0.7, "left", ha="center") -fig.text(0.5, 0.7, "wspace", ha="center") -fig.text(0.95, 0.7, "right", ha="center") +fig.text(0.5, 0.3, "wspace", ha="center") +fig.text(0.05, 0.83, "right", ha="center") -arrow((0.25, 0), (0.25, 0.1)) # bottom -arrow((0.25, 0.435), (0.25, 0.565)) # hspace -arrow((0.25, 0.9), (0.25, 1)) # top -fig.text(0.28, 0.05, "bottom", va="center") +overlay.annotate("", (0.75, 0), (0.75, 0.1), + xycoords=xycoords, arrowprops=arrowprops) # bottom +overlay.annotate("", (0.25, 0.435), (0.25, 0.565), + xycoords=xycoords, arrowprops=arrowprops) # hspace +overlay.annotate("", (0.8, 0), (0.8, 0.9), + xycoords=xycoords, arrowprops=arrowprops) # top +fig.text(0.65, 0.05, "bottom", va="center") fig.text(0.28, 0.5, "hspace", va="center") -fig.text(0.28, 0.95, "top", va="center") +fig.text(0.82, 0.05, "top", va="center") From b81427cabae98716eda5d27134a882682754de26 Mon Sep 17 00:00:00 2001 From: Tim Hoffmann <2836374+timhoffm@users.noreply.github.com> Date: Fri, 9 May 2025 23:06:22 +0200 Subject: [PATCH 03/11] Update doc/_embedded_plots/figure_subplots_adjust.py Fix flake8 --- doc/_embedded_plots/figure_subplots_adjust.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/_embedded_plots/figure_subplots_adjust.py b/doc/_embedded_plots/figure_subplots_adjust.py index 6f99a3febcdc..d32a029fe05d 100644 --- a/doc/_embedded_plots/figure_subplots_adjust.py +++ b/doc/_embedded_plots/figure_subplots_adjust.py @@ -7,8 +7,8 @@ overlay = fig.add_axes([0, 0, 1, 1], zorder=100) overlay.axis("off") -xycoords='figure fraction' -arrowprops=dict(arrowstyle="<->", shrinkA=0, shrinkB=0) +xycoords = 'figure fraction' +arrowprops = dict(arrowstyle="<->", shrinkA=0, shrinkB=0) for ax in axs.flat: ax.set(xticks=[], yticks=[]) From e188484b9ccacbda63c401fe925e93a10d73eac8 Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Wed, 4 Jun 2025 16:11:33 -0400 Subject: [PATCH 04/11] Backport PR #30118: CI: Skip jobs on forks --- .github/workflows/cibuildwheel.yml | 38 +++++++++++++++------------ .github/workflows/codeql-analysis.yml | 1 + .github/workflows/conflictcheck.yml | 1 + 3 files changed, 23 insertions(+), 17 deletions(-) diff --git a/.github/workflows/cibuildwheel.yml b/.github/workflows/cibuildwheel.yml index 79d770d0c8f4..3eddbb402e6a 100644 --- a/.github/workflows/cibuildwheel.yml +++ b/.github/workflows/cibuildwheel.yml @@ -24,14 +24,16 @@ permissions: jobs: build_sdist: if: >- - github.event_name == 'push' || - github.event_name == 'pull_request' && ( - ( - github.event.action == 'labeled' && - github.event.label.name == 'CI: Run cibuildwheel' - ) || - contains(github.event.pull_request.labels.*.name, - 'CI: Run cibuildwheel') + github.repository == 'matplotlib/matplotlib' && ( + github.event_name == 'push' || + github.event_name == 'pull_request' && ( + ( + github.event.action == 'labeled' && + github.event.label.name == 'CI: Run cibuildwheel' + ) || + contains(github.event.pull_request.labels.*.name, + 'CI: Run cibuildwheel') + ) ) name: Build sdist runs-on: ubuntu-latest @@ -78,14 +80,16 @@ jobs: build_wheels: if: >- - github.event_name == 'push' || - github.event_name == 'pull_request' && ( - ( - github.event.action == 'labeled' && - github.event.label.name == 'CI: Run cibuildwheel' - ) || - contains(github.event.pull_request.labels.*.name, - 'CI: Run cibuildwheel') + github.repository == 'matplotlib/matplotlib' && ( + github.event_name == 'push' || + github.event_name == 'pull_request' && ( + ( + github.event.action == 'labeled' && + github.event.label.name == 'CI: Run cibuildwheel' + ) || + contains(github.event.pull_request.labels.*.name, + 'CI: Run cibuildwheel') + ) ) needs: build_sdist name: Build wheels on ${{ matrix.os }} for ${{ matrix.cibw_archs }} @@ -188,7 +192,7 @@ jobs: if-no-files-found: error publish: - if: github.event_name == 'push' && github.ref_type == 'tag' + if: github.repository == 'matplotlib/matplotlib' && github.event_name == 'push' && github.ref_type == 'tag' name: Upload release to PyPI needs: [build_sdist, build_wheels] runs-on: ubuntu-latest diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 089b15700f1b..7a15de609834 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -12,6 +12,7 @@ on: jobs: analyze: + if: github.repository == 'matplotlib/matplotlib' name: Analyze runs-on: ubuntu-latest permissions: diff --git a/.github/workflows/conflictcheck.yml b/.github/workflows/conflictcheck.yml index b018101f325c..c9aa036004e7 100644 --- a/.github/workflows/conflictcheck.yml +++ b/.github/workflows/conflictcheck.yml @@ -11,6 +11,7 @@ on: jobs: main: + if: github.repository == 'matplotlib/matplotlib' runs-on: ubuntu-latest permissions: pull-requests: write From 5bdbb3ad9d982f58174f0ae10323364760ece24e Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Fri, 30 May 2025 01:50:50 -0400 Subject: [PATCH 05/11] Backport PR #30119: Add some types to _mathtext.py --- lib/matplotlib/_mathtext.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/matplotlib/_mathtext.py b/lib/matplotlib/_mathtext.py index 7085a986414e..9e20ea3da9b7 100644 --- a/lib/matplotlib/_mathtext.py +++ b/lib/matplotlib/_mathtext.py @@ -2521,10 +2521,10 @@ def subsuper(self, s: str, loc: int, toks: ParseResults) -> T.Any: if len(new_children): # remove last kern if (isinstance(new_children[-1], Kern) and - hasattr(new_children[-2], '_metrics')): + isinstance(new_children[-2], Char)): new_children = new_children[:-1] last_char = new_children[-1] - if hasattr(last_char, '_metrics'): + if isinstance(last_char, Char): last_char.width = last_char._metrics.advance # create new Hlist without kerning nucleus = Hlist(new_children, do_kern=False) @@ -2600,7 +2600,7 @@ def subsuper(self, s: str, loc: int, toks: ParseResults) -> T.Any: # Do we need to add a space after the nucleus? # To find out, check the flag set by operatorname - spaced_nucleus = [nucleus, x] + spaced_nucleus: list[Node] = [nucleus, x] if self._in_subscript_or_superscript: spaced_nucleus += [self._make_space(self._space_widths[r'\,'])] self._in_subscript_or_superscript = False From 3950d996236581bf7d53f29ffd7fc33434687552 Mon Sep 17 00:00:00 2001 From: Jody Klymak Date: Thu, 19 Jun 2025 15:09:33 -0700 Subject: [PATCH 06/11] Backport PR #30180: DOC: expand polar example --- .../pie_and_polar_charts/polar_demo.py | 26 +++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/galleries/examples/pie_and_polar_charts/polar_demo.py b/galleries/examples/pie_and_polar_charts/polar_demo.py index e4967079d19d..909fea094be5 100644 --- a/galleries/examples/pie_and_polar_charts/polar_demo.py +++ b/galleries/examples/pie_and_polar_charts/polar_demo.py @@ -4,6 +4,11 @@ ========== Demo of a line plot on a polar axis. + +The second plot shows the same data, but with the radial axis starting at r=1 +and the angular axis starting at 0 degrees and ending at 225 degrees. Setting +the origin of the radial axis to 0 allows the radial ticks to be placed at the +same location as the first plot. """ import matplotlib.pyplot as plt import numpy as np @@ -11,14 +16,29 @@ r = np.arange(0, 2, 0.01) theta = 2 * np.pi * r -fig, ax = plt.subplots(subplot_kw={'projection': 'polar'}) +fig, axs = plt.subplots(2, 1, figsize=(5, 8), subplot_kw={'projection': 'polar'}, + layout='constrained') +ax = axs[0] ax.plot(theta, r) ax.set_rmax(2) -ax.set_rticks([0.5, 1, 1.5, 2]) # Less radial ticks +ax.set_rticks([0.5, 1, 1.5, 2]) # Fewer radial ticks ax.set_rlabel_position(-22.5) # Move radial labels away from plotted line ax.grid(True) ax.set_title("A line plot on a polar axis", va='bottom') + +ax = axs[1] +ax.plot(theta, r) +ax.set_rmax(2) +ax.set_rmin(1) # Change the radial axis to only go from 1 to 2 +ax.set_rorigin(0) # Set the origin of the radial axis to 0 +ax.set_thetamin(0) +ax.set_thetamax(225) +ax.set_rticks([1, 1.5, 2]) # Fewer radial ticks +ax.set_rlabel_position(-22.5) # Move radial labels away from plotted line + +ax.grid(True) +ax.set_title("Same plot, but with reduced axis limits", va='bottom') plt.show() # %% @@ -32,6 +52,8 @@ # - `matplotlib.projections.polar` # - `matplotlib.projections.polar.PolarAxes` # - `matplotlib.projections.polar.PolarAxes.set_rticks` +# - `matplotlib.projections.polar.PolarAxes.set_rmin` +# - `matplotlib.projections.polar.PolarAxes.set_rorigin` # - `matplotlib.projections.polar.PolarAxes.set_rmax` # - `matplotlib.projections.polar.PolarAxes.set_rlabel_position` # From 96512fd4835d61e037974944b355edcc131b5f46 Mon Sep 17 00:00:00 2001 From: Tim Hoffmann <2836374+timhoffm@users.noreply.github.com> Date: Wed, 25 Jun 2025 09:08:40 +0200 Subject: [PATCH 07/11] Backport PR #30212: [Doc]: fix bug in release notes for matplotlib v3.5.0 and v3.7.0 --- doc/api/prev_api_changes/api_changes_3.5.0/deprecations.rst | 2 +- doc/api/prev_api_changes/api_changes_3.7.0/removals.rst | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/api/prev_api_changes/api_changes_3.5.0/deprecations.rst b/doc/api/prev_api_changes/api_changes_3.5.0/deprecations.rst index d10da55a97f8..742a18f04072 100644 --- a/doc/api/prev_api_changes/api_changes_3.5.0/deprecations.rst +++ b/doc/api/prev_api_changes/api_changes_3.5.0/deprecations.rst @@ -282,7 +282,7 @@ Miscellaneous deprecations - The *format* parameter of ``dviread.find_tex_file`` is deprecated (with no replacement). - ``FancyArrowPatch.get_path_in_displaycoord`` and - ``ConnectionPath.get_path_in_displaycoord`` are deprecated. The path in + ``ConnectionPatch.get_path_in_displaycoord`` are deprecated. The path in display coordinates can still be obtained, as for other patches, using ``patch.get_transform().transform_path(patch.get_path())``. - The ``font_manager.win32InstalledFonts`` and diff --git a/doc/api/prev_api_changes/api_changes_3.7.0/removals.rst b/doc/api/prev_api_changes/api_changes_3.7.0/removals.rst index 03239be31057..56b3ad5c253e 100644 --- a/doc/api/prev_api_changes/api_changes_3.7.0/removals.rst +++ b/doc/api/prev_api_changes/api_changes_3.7.0/removals.rst @@ -323,7 +323,7 @@ Miscellaneous removals - The *format* parameter of ``dviread.find_tex_file`` is removed (with no replacement). - ``FancyArrowPatch.get_path_in_displaycoord`` and - ``ConnectionPath.get_path_in_displaycoord`` are removed. The path in + ``ConnectionPatch.get_path_in_displaycoord`` are removed. The path in display coordinates can still be obtained, as for other patches, using ``patch.get_transform().transform_path(patch.get_path())``. - The ``font_manager.win32InstalledFonts`` and From b1226396211d5280dcecf55929f2df3fd62cc8a0 Mon Sep 17 00:00:00 2001 From: Jody Klymak Date: Wed, 2 Jul 2025 07:40:25 -0700 Subject: [PATCH 08/11] Backport PR #30244: DOC: Recommend to use bare Figure instances for saving to file --- doc/users/faq.rst | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/doc/users/faq.rst b/doc/users/faq.rst index 592fff551099..87a1af03d96e 100644 --- a/doc/users/faq.rst +++ b/doc/users/faq.rst @@ -281,8 +281,23 @@ locators as desired because the two axes are independent. Generate images without having a window appear ---------------------------------------------- -Simply do not call `~matplotlib.pyplot.show`, and directly save the figure to -the desired format:: +The recommended approach since matplotlib 3.1 is to explicitly create a Figure +instance:: + + from matplotlib.figure import Figure + fig = Figure() + ax = fig.subplots() + ax.plot([1, 2, 3]) + fig.savefig('myfig.png') + +This prevents any interaction with GUI frameworks and the window manager. + +It's alternatively still possible to use the pyplot interface. Instead of +calling `matplotlib.pyplot.show`, call `matplotlib.pyplot.savefig`. + +Additionally, you must ensure to close the figure after saving it. Not +closing the figure is a memory leak, because pyplot keeps references +to all not-yet-shown figures:: import matplotlib.pyplot as plt plt.plot([1, 2, 3]) From 74d8632fa71aadc21037de776284e26aa4c2351d Mon Sep 17 00:00:00 2001 From: hannah Date: Fri, 11 Jul 2025 14:11:06 -0400 Subject: [PATCH 09/11] Backport PR #30289: DOC: Fix build with pybind11 3 --- doc/missing-references.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/doc/missing-references.json b/doc/missing-references.json index 1a816d19f7cd..e3b23db6fbc8 100644 --- a/doc/missing-references.json +++ b/doc/missing-references.json @@ -261,8 +261,12 @@ "doc/api/_as_gen/mpl_toolkits.axisartist.floating_axes.rst:32::1" ], "numpy.float64": [ + "doc/docstring of matplotlib.ft2font.pybind11_detail_function_record_v1_system_libstdcpp_gxx_abi_1xxx_use_cxx11_abi_1.set_text:1", "doc/docstring of matplotlib.ft2font.PyCapsule.set_text:1" ], + "numpy.typing.NDArray": [ + "doc/docstring of matplotlib.ft2font.pybind11_detail_function_record_v1_system_libstdcpp_gxx_abi_1xxx_use_cxx11_abi_1.set_text:1" + ], "numpy.uint8": [ ":1" ] From b17b0623880de7b44d4b9625b34b7af33582846c Mon Sep 17 00:00:00 2001 From: Kyle Sunden Date: Thu, 31 Jul 2025 14:05:00 -0500 Subject: [PATCH 10/11] Zenodo v3.10.5 --- doc/_static/zenodo_cache/16644850.svg | 35 +++++++++++++++++++++++++++ doc/project/citing.rst | 3 +++ tools/cache_zenodo_svg.py | 1 + 3 files changed, 39 insertions(+) create mode 100644 doc/_static/zenodo_cache/16644850.svg diff --git a/doc/_static/zenodo_cache/16644850.svg b/doc/_static/zenodo_cache/16644850.svg new file mode 100644 index 000000000000..89910032da4e --- /dev/null +++ b/doc/_static/zenodo_cache/16644850.svg @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + DOI + + + DOI + + + 10.5281/zenodo.16644850 + + + 10.5281/zenodo.16644850 + + + \ No newline at end of file diff --git a/doc/project/citing.rst b/doc/project/citing.rst index 8b4c323229ca..249f568625db 100644 --- a/doc/project/citing.rst +++ b/doc/project/citing.rst @@ -32,6 +32,9 @@ By version .. START OF AUTOGENERATED +v3.10.5 + .. image:: ../_static/zenodo_cache/16644850.svg + :target: https://doi.org/10.5281/zenodo.16644850 v3.10.3 .. image:: ../_static/zenodo_cache/15375714.svg :target: https://doi.org/10.5281/zenodo.15375714 diff --git a/tools/cache_zenodo_svg.py b/tools/cache_zenodo_svg.py index 229e90efeb34..59d6fce55162 100644 --- a/tools/cache_zenodo_svg.py +++ b/tools/cache_zenodo_svg.py @@ -63,6 +63,7 @@ def _get_xdg_cache_dir(): if __name__ == "__main__": data = { + "v3.10.5": "16644850", "v3.10.3": "15375714", "v3.10.1": "14940554", "v3.10.0": "14464227", From e44495f9f940adc5003795386c70675595908262 Mon Sep 17 00:00:00 2001 From: Tim Hoffmann <2836374+timhoffm@users.noreply.github.com> Date: Sun, 24 Aug 2025 08:26:54 +0200 Subject: [PATCH 11/11] Backport PR #30451: doc: factor out quick install tab for reuse --- doc/index.rst | 55 +++-------------------------- doc/install/index.rst | 7 +++- doc/install/quick_install.inc.rst | 54 ++++++++++++++++++++++++++++ doc/users/getting_started/index.rst | 21 +---------- 4 files changed, 65 insertions(+), 72 deletions(-) create mode 100644 doc/install/quick_install.inc.rst diff --git a/doc/index.rst b/doc/index.rst index 74a183d6cd7b..c5b25b6d37aa 100644 --- a/doc/index.rst +++ b/doc/index.rst @@ -14,59 +14,12 @@ and interactive visualizations. Install ======= -.. tab-set:: - :class: sd-width-content-min +.. include:: install/quick_install.inc.rst - .. tab-item:: pip +.. toctree:: + :hidden: - .. code-block:: bash - - pip install matplotlib - - .. tab-item:: conda - - .. code-block:: bash - - conda install -c conda-forge matplotlib - - .. tab-item:: pixi - - .. code-block:: bash - - pixi add matplotlib - - .. tab-item:: uv - - .. code-block:: bash - - uv add matplotlib - - .. warning:: - - If you install Python with ``uv`` then the ``tkagg`` backend - will not be available because python-build-standalone (used by uv - to distribute Python) does not contain tk bindings that are usable by - Matplotlib (see `this issue`_ for details). If you want Matplotlib - to be able to display plots in a window, you should install one of - the other :ref:`supported GUI frameworks `, - e.g. - - .. code-block:: bash - - uv add matplotlib pyside6 - - .. _this issue: https://github.com/astral-sh/uv/issues/6893#issuecomment-2565965851 - - .. tab-item:: other - - .. rst-class:: section-toc - .. toctree:: - :maxdepth: 2 - - install/index - -For more detailed instructions, see the -:doc:`installation guide `. + install/index Learn ===== diff --git a/doc/install/index.rst b/doc/install/index.rst index 2d9e724e6a73..eb5e02f98868 100644 --- a/doc/install/index.rst +++ b/doc/install/index.rst @@ -5,6 +5,9 @@ Installation ************ +.. include:: quick_install.inc.rst + +.. _install-official: Install an official release =========================== @@ -35,6 +38,7 @@ precompiled wheel for your OS and Python. animations and a larger selection of file formats, you can install :ref:`optional dependencies `. +.. _install-third-party: Third-party distributions ========================= @@ -81,7 +85,7 @@ you can install Matplotlib via your package manager, e.g.: .. redirect-from:: /users/installing/installing_source -.. _install_from_source: +.. _install-nightly-build: Install a nightly build ======================= @@ -101,6 +105,7 @@ scientific-python-nightly-wheels as the package index to query: --extra-index-url https://pypi.org/simple \ matplotlib +.. _install-source: Install from source =================== diff --git a/doc/install/quick_install.inc.rst b/doc/install/quick_install.inc.rst new file mode 100644 index 000000000000..2e75b332f6ed --- /dev/null +++ b/doc/install/quick_install.inc.rst @@ -0,0 +1,54 @@ +.. set of quick install commands for reuse across docs + +.. tab-set:: + :class: sd-width-content-min + + .. tab-item:: pip + + .. code-block:: bash + + pip install matplotlib + + .. tab-item:: conda + + .. code-block:: bash + + conda install -c conda-forge matplotlib + + .. tab-item:: pixi + + .. code-block:: bash + + pixi add matplotlib + + .. tab-item:: uv + + .. code-block:: bash + + uv add matplotlib + + .. warning:: + + If you install Python with ``uv`` then the ``tkagg`` backend + will not be available because python-build-standalone (used by uv + to distribute Python) does not contain tk bindings that are usable by + Matplotlib (see `this issue`_ for details). If you want Matplotlib + to be able to display plots in a window, you should install one of + the other :ref:`supported GUI frameworks `, + e.g. + + .. code-block:: bash + + uv add matplotlib pyside6 + + .. _this issue: https://github.com/astral-sh/uv/issues/6893#issuecomment-2565965851 + + .. tab-item:: other + + :ref:`install-official` + + :ref:`install-third-party` + + :ref:`install-nightly-build` + + :ref:`install-source` diff --git a/doc/users/getting_started/index.rst b/doc/users/getting_started/index.rst index ac896687979d..dfbbd615b5cd 100644 --- a/doc/users/getting_started/index.rst +++ b/doc/users/getting_started/index.rst @@ -4,26 +4,7 @@ Getting started Installation quick-start ------------------------ -.. grid:: 1 1 2 2 - - .. grid-item:: - - Install using `pip `__: - - .. code-block:: bash - - pip install matplotlib - - .. grid-item:: - - Install using `conda `__: - - .. code-block:: bash - - conda install -c conda-forge matplotlib - -Further details are available in the :doc:`Installation Guide `. - +.. include:: /install/quick_install.inc.rst Draw a first plot -----------------