diff --git a/.appveyor.yml b/.appveyor.yml index 668c5391de65..49611c66a254 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -23,13 +23,14 @@ environment: # In theory we could use a single CONDA_INSTALL_LOCN because we construct # the envs anyway. But using one for the right python version hopefully # making things faster due to package caching. - - PYTHON_VERSION: "3.6" - CONDA_INSTALL_LOCN: "C:\\Miniconda36-x64" + - PYTHON_VERSION: "3.7" + CONDA_INSTALL_LOCN: "C:\\Miniconda37-x64" TEST_ALL: "no" EXTRAREQS: "-r requirements/testing/travis_extra.txt" - - PYTHON_VERSION: "3.7" + - PYTHON_VERSION: "3.8" CONDA_INSTALL_LOCN: "C:\\Miniconda37-x64" TEST_ALL: "no" + EXTRAREQS: "-r requirements/testing/travis_extra.txt" # We always use a 64-bit machine, but can build x86 distributions # with the PYTHON_ARCH variable @@ -55,19 +56,15 @@ install: # For building, use a new environment - conda create -q -n test-environment python=%PYTHON_VERSION% tk - activate test-environment + # pull pywin32 from conda because on py38 there is something wrong with finding + # the dlls when insalled from pip + - conda install -c conda-forge pywin32 - echo %PYTHON_VERSION% %TARGET_ARCH% # Install dependencies from PyPI. - python -mpip install --upgrade -r requirements/testing/travis_all.txt %EXTRAREQS% %PINNEDVERS% # Install optional dependencies from PyPI. # Sphinx is needed to run sphinxext tests - python -mpip install --upgrade sphinx - - # Apply patch to `subprocess` on Python versions > 2 and < 3.6.3 - # https://github.com/matplotlib/matplotlib/issues/9176 - - python -c "import sys; sys.exit(not (3,) < sys.version_info < (3,6,3))" && ( - curl -sL https://github.com/python/cpython/pull/1224.patch | - patch -fsup 1 -d %CONDA_PREFIX% ) || cmd /c "exit /b 0" - # Show the installed packages + versions - conda list diff --git a/.circleci/config.yml b/.circleci/config.yml index 87388469caba..48275404c92e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -4,76 +4,105 @@ version: 2.1 -########################################### -# Define some common steps as YAML anchors. +####################################### +# Define some common steps as commands. # -apt-run: &apt-install - name: Install apt packages - command: | - sudo apt -qq update - sudo apt install -y \ - inkscape \ - ffmpeg \ - dvipng \ - lmodern \ - cm-super \ - texlive-latex-base \ - texlive-latex-extra \ - texlive-fonts-recommended \ - texlive-latex-recommended \ - texlive-pictures \ - texlive-xetex \ - graphviz \ - fonts-crosextra-carlito \ - fonts-freefont-otf \ - fonts-humor-sans \ - optipng - -fonts-run: &fonts-install - name: Install custom fonts - command: | - mkdir -p ~/.local/share/fonts - wget -nc https://github.com/google/fonts/blob/master/ofl/felipa/Felipa-Regular.ttf?raw=true -O ~/.local/share/fonts/Felipa-Regular.ttf || true - fc-cache -f -v - save_cache: - key: fonts-2 - paths: - - ~/.local/share/fonts/ - restore_cache: - key: fonts-2 - -pip-run: &pip-install - # Upgrade pip and setuptools and wheel to get as clean an install as possible - name: Upgrade pip, setuptools, wheel - command: | - python -mpip install --upgrade --user pip - python -mpip install --upgrade --user wheel - python -mpip install --upgrade --user setuptools - -deps-run: &deps-install - name: Install Python dependencies - command: | - python -mpip install --user numpy${NUMPY_VERSION} codecov coverage - python -mpip install --user -r requirements/doc/doc-requirements.txt - -mpl-run: &mpl-install - name: Install Matplotlib - command: python -mpip install --user -ve . - -doc-run: &doc-build - name: Build documentation - command: | - # Set epoch to date of latest tag. - export SOURCE_DATE_EPOCH="$(git log -1 --format=%at $(git describe --abbrev=0))" - make html O=-T - rm -r build/html/_sources - working_directory: doc - -doc-bundle-run: &doc-bundle - name: Bundle sphinx-gallery documentation artifacts - command: tar cf doc/build/sphinx-gallery-files.tar.gz doc/api/_as_gen doc/gallery doc/tutorials - when: always +commands: + apt-install: + steps: + - run: + name: Install apt packages + command: | + sudo apt -qq update + sudo apt install -y \ + inkscape \ + ffmpeg \ + dvipng \ + lmodern \ + cm-super \ + texlive-latex-base \ + texlive-latex-extra \ + texlive-fonts-recommended \ + texlive-latex-recommended \ + texlive-pictures \ + texlive-xetex \ + graphviz \ + fonts-crosextra-carlito \ + fonts-freefont-otf \ + fonts-humor-sans \ + optipng + + fonts-install: + steps: + - restore_cache: + key: fonts-2 + - run: + name: Install custom fonts + command: | + mkdir -p ~/.local/share/fonts + wget -nc https://github.com/google/fonts/blob/master/ofl/felipa/Felipa-Regular.ttf?raw=true -O ~/.local/share/fonts/Felipa-Regular.ttf || true + fc-cache -f -v + - save_cache: + key: fonts-2 + paths: + - ~/.local/share/fonts/ + + pip-install: + description: Upgrade pip and setuptools and wheel to get as clean an install as possible + steps: + - run: + name: Upgrade pip, setuptools, wheel + command: | + python -mpip install --upgrade --user pip + python -mpip install --upgrade --user wheel + python -mpip install --upgrade --user setuptools + + deps-install: + parameters: + numpy_version: + type: string + default: "" + steps: + - run: + name: Install Python dependencies + command: | + python -mpip install --user numpy<< parameters.numpy_version >> codecov coverage + python -mpip install --user -r requirements/doc/doc-requirements.txt + + mpl-install: + steps: + - run: + name: Install Matplotlib + command: python -mpip install --user -ve . + + doc-build: + steps: + - restore_cache: + keys: + - sphinx-env-v1-{{ .BuildNum }}-{{ .Environment.CIRCLE_JOB }} + - sphinx-env-v1-{{ .Environment.CIRCLE_PREVIOUS_BUILD_NUM }}-{{ .Environment.CIRCLE_JOB }} + - run: + name: Build documentation + command: | + # Set epoch to date of latest tag. + export SOURCE_DATE_EPOCH="$(git log -1 --format=%at $(git describe --abbrev=0))" + make html O=-T + rm -r build/html/_sources + working_directory: doc + - save_cache: + key: sphinx-env-v1-{{ .BuildNum }}-{{ .Environment.CIRCLE_JOB }} + paths: + - doc/build/doctrees + + doc-bundle: + steps: + - run: + name: Bundle sphinx-gallery documentation artifacts + command: tar cf doc/build/sphinx-gallery-files.tar.gz doc/api/_as_gen doc/gallery doc/tutorials + when: always + - store_artifacts: + path: doc/build/sphinx-gallery-files.tar.gz ########################################## @@ -81,48 +110,43 @@ doc-bundle-run: &doc-bundle # jobs: - docs-python36: + docs-python37: docker: - - image: circleci/python:3.6 + - image: circleci/python:3.7 steps: - checkout - - run: *apt-install - - run: *fonts-install - - run: *pip-install - - run: - <<: *deps-install - environment: - NUMPY_VERSION: "==1.13.0" - - run: *mpl-install + - apt-install + - fonts-install + - pip-install - - run: *doc-build + - deps-install + - mpl-install - - run: *doc-bundle - - store_artifacts: - path: doc/build/sphinx-gallery-files.tar.gz + - doc-build + + - doc-bundle - store_artifacts: path: doc/build/html - docs-python37: + docs-python38-min: docker: - - image: circleci/python:3.7 + - image: circleci/python:3.8 steps: - checkout - - run: *apt-install - - run: *fonts-install - - run: *pip-install + - apt-install + - fonts-install + - pip-install - - run: *deps-install - - run: *mpl-install + - deps-install: + numpy_version: "==1.16.0" + - mpl-install - - run: *doc-build + - doc-build - - run: *doc-bundle - - store_artifacts: - path: doc/build/sphinx-gallery-files.tar.gz + - doc-bundle - store_artifacts: path: doc/build/html @@ -133,18 +157,16 @@ jobs: steps: - checkout - - run: *apt-install - - run: *fonts-install - - run: *pip-install + - apt-install + - fonts-install + - pip-install - - run: *deps-install - - run: *mpl-install + - deps-install + - mpl-install - - run: *doc-build + - doc-build - - run: *doc-bundle - - store_artifacts: - path: doc/build/sphinx-gallery-files.tar.gz + - doc-bundle - store_artifacts: path: doc/build/html @@ -164,6 +186,6 @@ workflows: version: 2 build: jobs: - - docs-python36 - docs-python37 - docs-python38 + - docs-python38-min diff --git a/.circleci/deploy-docs.sh b/.circleci/deploy-docs.sh index e6a51e58d8ad..83037d2561a4 100755 --- a/.circleci/deploy-docs.sh +++ b/.circleci/deploy-docs.sh @@ -2,8 +2,13 @@ set -e -if [ "$CIRCLE_PROJECT_USERNAME" != "matplotlib" -o "$CIRCLE_BRANCH" != "master" -o "$CIRCLE_PULL_REQUEST" != "" ]; then - echo "Not uploading docs from non-master branch or non-Matplotlib org." +if [ "$CIRCLE_PROJECT_USERNAME" != "matplotlib" ] || \ + [ "$CIRCLE_BRANCH" != "master" ] || \ + [[ "$CIRCLE_PULL_REQUEST" == https://github.com/matplotlib/matplotlib/pull/* ]]; then + echo "Not uploading docs for ${CIRCLE_SHA1}"\ + "from non-master branch (${CIRCLE_BRANCH})"\ + "or pull request (${CIRCLE_PULL_REQUEST})"\ + "or non-Matplotlib org (${CIRCLE_PROJECT_USERNAME})." exit fi diff --git a/.flake8 b/.flake8 index be20a443016d..4560fc4d319f 100644 --- a/.flake8 +++ b/.flake8 @@ -65,7 +65,6 @@ per-file-ignores = lib/matplotlib/pyplot.py: F401, F811 lib/matplotlib/style/__init__.py: F401 lib/matplotlib/testing/conftest.py: F401 - lib/matplotlib/testing/decorators.py: F401 lib/matplotlib/tests/conftest.py: F401 lib/matplotlib/tests/test_backend_qt.py: F401 lib/matplotlib/tests/test_mathtext.py: E501 @@ -158,6 +157,7 @@ per-file-ignores = examples/images_contours_and_fields/tripcolor_demo.py: E201, E402 examples/images_contours_and_fields/triplot_demo.py: E201, E402 examples/images_contours_and_fields/watermark_image.py: E402 + examples/lines_bars_and_markers/curve_error_band.py: E402 examples/lines_bars_and_markers/errorbar_limits_simple.py: E402 examples/lines_bars_and_markers/fill.py: E402 examples/lines_bars_and_markers/fill_between_demo.py: E402 @@ -225,6 +225,7 @@ per-file-ignores = examples/shapes_and_collections/ellipse_demo.py: E402 examples/shapes_and_collections/fancybox_demo.py: E402 examples/shapes_and_collections/hatch_demo.py: E402 + examples/shapes_and_collections/hatch_style_reference.py: E402 examples/shapes_and_collections/line_collection.py: E402 examples/shapes_and_collections/marker_path.py: E402 examples/shapes_and_collections/patch_collection.py: E402 diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 677baee590db..8bc740303492 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -7,7 +7,7 @@ - [ ] New features are documented, with examples if plot related - [ ] Documentation is sphinx and numpydoc compliant - [ ] Added an entry to doc/users/next_whats_new/ if major new feature (follow instructions in README.rst there) -- [ ] Documented in doc/api/api_changes.rst if API changed in a backward-incompatible way +- [ ] Documented in doc/api/next_api_changes/* if API changed in a backward-incompatible way +
{%- if builder in ('htmlhelp', 'devhelp', 'latex') %} diff --git a/doc/api/animation_api.rst b/doc/api/animation_api.rst index 9486dfe289c7..c8edde884046 100644 --- a/doc/api/animation_api.rst +++ b/doc/api/animation_api.rst @@ -55,7 +55,7 @@ performance), to be non-blocking, not repeatedly start/stop the GUI event loop, handle repeats, multiple animated axes, and easily save the animation to a movie file. -'Blitting' is a `old technique +'Blitting' is a `standard technique `__ in computer graphics. The general gist is to take an existing bit map (in our case a mostly rasterized figure) and then 'blit' one more artist on top. Thus, by diff --git a/doc/api/api_changes.rst b/doc/api/api_changes.rst index 63f4e41de716..e67cdd781d30 100644 --- a/doc/api/api_changes.rst +++ b/doc/api/api_changes.rst @@ -14,7 +14,7 @@ For API changes in older versions see api_changes_old Changes for the latest version are listed below. For new features that were -added to Matplotlib, see :ref:`whats-new`. +added to Matplotlib, see :ref:`whats-new` .. ifconfig:: releaselevel == 'dev' @@ -33,6 +33,9 @@ added to Matplotlib, see :ref:`whats-new`. :glob: :maxdepth: 1 - api_changes_3.3/* + next_api_changes/behavior/* + next_api_changes/deprecations/* + next_api_changes/development/* + next_api_changes/removals/* -.. include:: prev_api_changes/api_changes_3.2.0.rst +.. include:: prev_api_changes/api_changes_3.3.0.rst diff --git a/doc/api/api_changes/2019-02-11-PGE.rst b/doc/api/api_changes/2019-02-11-PGE.rst deleted file mode 100644 index 90c05b2ca8bf..000000000000 --- a/doc/api/api_changes/2019-02-11-PGE.rst +++ /dev/null @@ -1,4 +0,0 @@ -Added support for RGB(A) images in pcolorfast -````````````````````````````````````````````` - -pcolorfast now accepts 3D images (RGB or RGBA) arrays. diff --git a/doc/api/api_changes_3.3/2019-04-25-AL.rst b/doc/api/api_changes_3.3/2019-04-25-AL.rst deleted file mode 100644 index 205f103846a1..000000000000 --- a/doc/api/api_changes_3.3/2019-04-25-AL.rst +++ /dev/null @@ -1,5 +0,0 @@ -Deprecations -```````````` - -The ``TexManager.serif``, ``TexManager.sans_serif``, ``TexManager.cursive`` and -``TexManager.monospace`` attributes are deprecated. diff --git a/doc/api/api_changes_3.3/README.rst b/doc/api/api_changes_3.3/README.rst deleted file mode 100644 index a8c7538e5618..000000000000 --- a/doc/api/api_changes_3.3/README.rst +++ /dev/null @@ -1,29 +0,0 @@ -:orphan: - -Adding API change notes -======================= - -API change notes for future releases are collected in the most recent directory -:file:`api_changes_X.Y`. They are divided into four categories: - -- **Deprecations**: Announcements of future changes. Typically, these will - raise a deprecation warning and users of this API should change their code - to stay compatible with future releases of Matplotlib. If possible, state - what should be used instead. -- **Removals**: Parts of the API that got removed. If possible, state what - should be used instead. -- **Behaviour changes**: API that stays valid but will yield a different - result. -- **Development changes**: Changes to the build process, dependencies, etc. - -Please place new entries in the respective files in this directory. Typically, -each change will get its own section, but you may also amend existing sections -when suitable. The overall goal is a comprehensible documentation of the -changes. - -A typical entry could look like this:: - - Locators - ~~~~~~~~ - The unused `Locator.autoscale()` method is deprecated (pass the axis - limits to `Locator.view_limits()` instead). diff --git a/doc/api/axes_api.rst b/doc/api/axes_api.rst index b4ea5016d526..aa10872ddd35 100644 --- a/doc/api/axes_api.rst +++ b/doc/api/axes_api.rst @@ -150,8 +150,8 @@ Contours Axes.contour Axes.contourf -Array ------ +2D arrays +--------- .. autosummary:: :toctree: _as_gen @@ -165,7 +165,7 @@ Array Axes.pcolormesh Axes.spy -Unstructured Triangles +Unstructured triangles ---------------------- .. autosummary:: @@ -179,7 +179,7 @@ Unstructured Triangles Axes.tricontourf -Text and Annotations +Text and annotations -------------------- .. autosummary:: @@ -198,8 +198,8 @@ Text and Annotations Axes.secondary_yaxis -Fields ------- +Vector fields +------------- .. autosummary:: :toctree: _as_gen @@ -274,7 +274,7 @@ Axis / limits Axes.get_xaxis Axes.get_yaxis -Axis Limits and direction +Axis limits and direction ------------------------- .. autosummary:: @@ -300,7 +300,7 @@ Axis Limits and direction Axes.set_ybound Axes.get_ybound -Axis Labels, title, and legend +Axis labels, title, and legend ------------------------------ .. autosummary:: @@ -434,7 +434,7 @@ Units Axes.have_units -Adding Artists +Adding artists ============== .. autosummary:: @@ -470,7 +470,7 @@ Twinning and sharing Axes.get_shared_y_axes -Axes Position +Axes position ============= .. autosummary:: :toctree: _as_gen @@ -489,7 +489,7 @@ Axes Position Axes.set_position -Async/Event based +Async/event based ================= .. autosummary:: diff --git a/doc/api/next_api_changes/README.rst b/doc/api/next_api_changes/README.rst new file mode 100644 index 000000000000..de494911e6b2 --- /dev/null +++ b/doc/api/next_api_changes/README.rst @@ -0,0 +1,32 @@ +:orphan: + +Adding API change notes +======================= + +API change notes for future releases are collected in +:file:`next_api_changes`. They are divided into four subdirectories: + +- **Deprecations**: Announcements of future changes. Typically, these will + raise a deprecation warning and users of this API should change their code + to stay compatible with future releases of Matplotlib. If possible, state + what should be used instead. +- **Removals**: Parts of the API that got removed. If possible, state what + should be used instead. +- **Behaviour changes**: API that stays valid but will yield a different + result. +- **Development changes**: Changes to the build process, dependencies, etc. + +Please place new entries in these directories with a new file named +``99999-ABC.rst``, where ``99999`` would be the PR number, and ``ABC`` the +author's initials. Typically, each change will get its own file, but you may +also amend existing files when suitable. The overall goal is a comprehensible +documentation of the changes. + +Please avoid using references in section titles, as it causes links to be +confusing in the table of contents. Instead, ensure that a reference is +included in the descriptive text. A typical entry could look like this:: + + Locators + ~~~~~~~~ + The unused `Locator.autoscale()` method is deprecated (pass the axis + limits to `Locator.view_limits()` instead). diff --git a/doc/api/next_api_changes/behavior/00001-ABC.rst b/doc/api/next_api_changes/behavior/00001-ABC.rst new file mode 100644 index 000000000000..236f672c1123 --- /dev/null +++ b/doc/api/next_api_changes/behavior/00001-ABC.rst @@ -0,0 +1,7 @@ +Behavior Change template +~~~~~~~~~~~~~~~~~~~~~~~~ + +Enter description here.... + +Please rename file with PR number and your initials i.e. "99999-ABC.rst" +and ``git add`` the new file. diff --git a/doc/api/next_api_changes/behavior/17159-ST.rst b/doc/api/next_api_changes/behavior/17159-ST.rst new file mode 100644 index 000000000000..5aed41e9f352 --- /dev/null +++ b/doc/api/next_api_changes/behavior/17159-ST.rst @@ -0,0 +1,15 @@ +Consecutive rasterized draws now merged +--------------------------------------- + +Tracking of depth of raster draws has moved from +`.backend_mixed.MixedModeRenderer.start_rasterizing` and +`.backend_mixed.MixedModeRenderer.stop_rasterizing` into +`.artist.allow_rasterization`. This means the start and stop functions are +only called when the rasterization actually needs to be started and stopped. + +The output of vector backends will change in the case that rasterized +elements are merged. This should not change the appearance of outputs. + +The renders in 3rd party backends are now expected to have +``self._raster_depth`` and ``self._rasterizing`` initialized to ``0`` and +``False`` respectively. diff --git a/doc/api/next_api_changes/behavior/17727-JMK.rst b/doc/api/next_api_changes/behavior/17727-JMK.rst new file mode 100644 index 000000000000..cc6716f29184 --- /dev/null +++ b/doc/api/next_api_changes/behavior/17727-JMK.rst @@ -0,0 +1,10 @@ + +Date locator for DAILY interval now returns middle of month +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +The `matplotlib.dates.AutoDateLocator` has a default of +``interval_multiples=True`` that attempts to align ticks with the start of +meaningful intervals like the start of the month, or start of the day, etc. +That lead to approximately 140-day intervals being mapped to the first and 22nd +of the month. This has now been changed so that it chooses the first and +15th of the month, which is probably what most people want. diff --git a/doc/api/next_api_changes/behavior/17828-TAC.rst b/doc/api/next_api_changes/behavior/17828-TAC.rst new file mode 100644 index 000000000000..5781f9088f82 --- /dev/null +++ b/doc/api/next_api_changes/behavior/17828-TAC.rst @@ -0,0 +1,20 @@ +xunits=None and yunits=None passed as kwargs are treated as "no action" +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Many (but not all) of the methods on `~.axes.Axes` take the (undocumented) +kwargs *xunits* and *yunits* that will update the units on the given +Axis by calling `.Axis.set_units` and `.Axis.update_units`. + +Previously if `None` was passed it would clear the value stored in +``.Axis.units`` which will in turn break converters (notably +`.StrCategoryConverter`) which rely on the value in +``.Axis.units`` to work properly. + +This changes the semantics of ``ax.meth(..., xunits=None, +yunits=None)`` from "please clear the units" to "do the default thing +as if they had not been passed" which is consistent with the standard +behavior of Matplotlib keyword arguments. + +If you were relying on passing ``xuints=None`` to plotting methods to +clear the ``.Axes.units`` attribute, directly call `.Axis.set_units` (and +`.Axis.update_units` if you also require the converter to be updated). diff --git a/doc/api/next_api_changes/behavior/17834-AL.rst b/doc/api/next_api_changes/behavior/17834-AL.rst new file mode 100644 index 000000000000..027077dc1598 --- /dev/null +++ b/doc/api/next_api_changes/behavior/17834-AL.rst @@ -0,0 +1,5 @@ +``Colorbar.dividers`` changes +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +This attribute is now always a `.LineCollection` -- an empty one if +``drawedges`` is False. Its default colors and linewidth (:rc:`axes.edgecolor`, +:rc:`axes.linewidth`) are now resolved at instantiation time, not at draw time. diff --git a/doc/api/next_api_changes/behavior/17897-KLP.rst b/doc/api/next_api_changes/behavior/17897-KLP.rst new file mode 100644 index 000000000000..f53534e8d1b9 --- /dev/null +++ b/doc/api/next_api_changes/behavior/17897-KLP.rst @@ -0,0 +1,11 @@ +pyplot.specgram always uses origin='upper' +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Previously if ``image.origin`` was set to something other than 'upper' or if the +``origin`` keyword argument was passed with a value other than 'upper', the spectrogram +itself would flip, but the axes would remain oriented for an origin value of 'upper', so +that the resulting plot was incorrectly labelled. + +Now, the ``origin`` keyword argument is not supported and the ``image.origin`` rcParam is +ignored. The function matplotlib.pyplot.specgram is forced to use ``origin='upper'``, so +that the axes are correct for the plotted spectrogram. diff --git a/doc/api/next_api_changes/deprecations/00001-ABC.rst b/doc/api/next_api_changes/deprecations/00001-ABC.rst new file mode 100644 index 000000000000..541047ed1d8d --- /dev/null +++ b/doc/api/next_api_changes/deprecations/00001-ABC.rst @@ -0,0 +1,7 @@ +Template for deprecations +~~~~~~~~~~~~~~~~~~~~~~~~~ + +Add description here... + +Please rename file with PR number and your initials i.e. "99999-ABC.rst" +and ``git add`` the new file. diff --git a/doc/api/next_api_changes/deprecations/00009-AL.rst b/doc/api/next_api_changes/deprecations/00009-AL.rst new file mode 100644 index 000000000000..db8fbfd80f0c --- /dev/null +++ b/doc/api/next_api_changes/deprecations/00009-AL.rst @@ -0,0 +1,19 @@ +``dpi_cor`` property of `.FancyArrowPatch` +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +This parameter is considered internal and deprecated. + +Colorbar docstrings +~~~~~~~~~~~~~~~~~~~ +The following globals in :mod:`matplotlib.colorbar` are deprecated: +``colorbar_doc``, ``colormap_kw_doc``, ``make_axes_kw_doc``. + +``FancyBboxPatch(..., boxstyle="custom", bbox_transmuter=...)`` +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +In order to use a custom boxstyle, directly pass it as the *boxstyle* argument +to `.FancyBboxPatch`. This was previously already possible, and is consistent +with custom arrow styles and connection styles. + +``FigureCanvasBase.get_window_title`` and ``FigureCanvasBase.set_window_title`` +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +... are deprecated. Use the corresponding methods on the FigureManager if +using pyplot, or GUI-specific methods if embedding. diff --git a/doc/api/next_api_changes/deprecations/12443-AL.rst b/doc/api/next_api_changes/deprecations/12443-AL.rst new file mode 100644 index 000000000000..cc1b6bac2c04 --- /dev/null +++ b/doc/api/next_api_changes/deprecations/12443-AL.rst @@ -0,0 +1,8 @@ +``colorbar`` now warns when the mappable's axes is different from the current axes +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Currently, `.Figure.colorbar` and `.pyplot.colorbar` steal space by default +from the current axes to place the colorbar. In a future version, they will +steal space from the mappable's axes instead. In preparation for this change, +`.Figure.colorbar` and `.pyplot.colorbar` now emits a warning when the current +axes is not the same as the mappable's axes. diff --git a/doc/api/next_api_changes/deprecations/17662-TAC.rst b/doc/api/next_api_changes/deprecations/17662-TAC.rst new file mode 100644 index 000000000000..61791346679a --- /dev/null +++ b/doc/api/next_api_changes/deprecations/17662-TAC.rst @@ -0,0 +1,22 @@ +Increase minimum supported versions of Python and dependencies +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + +For Maptlotlib 3.4 the :ref:`minimum supported versions +` are being bumped + ++------------+-----------------+---------------+ +| Dependency | min in mpl3.3 | min in mpl3.4 | ++============+=================+===============+ +| Python | 3.6 | 3.7 | ++------------+-----------------+---------------+ +| dateutil | 2.1 | 2.2.1 | ++------------+-----------------+---------------+ +| numpy | 1.15 | 1.16 | ++------------+-----------------+---------------+ +| pyparsing | 2.0.3 | 2.2.1 | ++------------+-----------------+---------------+ + + +This consistent with our :ref:`min_deps_policy` and `NEP29 +`__ diff --git a/doc/api/next_api_changes/deprecations/17788-AL.rst b/doc/api/next_api_changes/deprecations/17788-AL.rst new file mode 100644 index 000000000000..7f4acc9894e0 --- /dev/null +++ b/doc/api/next_api_changes/deprecations/17788-AL.rst @@ -0,0 +1,3 @@ +``RendererAgg.get_content_extents``, ``RendererAgg.tostring_rgba_minimized`` +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +... are deprecated. diff --git a/doc/api/next_api_changes/deprecations/17926-ES.rst b/doc/api/next_api_changes/deprecations/17926-ES.rst new file mode 100644 index 000000000000..598737c7457a --- /dev/null +++ b/doc/api/next_api_changes/deprecations/17926-ES.rst @@ -0,0 +1,5 @@ +Invalid hatch pattern characters are no longer ignored +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +When specifying hatching patterns, characters that are not recognized will +raise a DeprecationWarning. In the future, this will become a hard error. diff --git a/doc/api/next_api_changes/deprecations/17983-JMK.rst b/doc/api/next_api_changes/deprecations/17983-JMK.rst new file mode 100644 index 000000000000..9d6500125bd9 --- /dev/null +++ b/doc/api/next_api_changes/deprecations/17983-JMK.rst @@ -0,0 +1,16 @@ +Reverted deprecation of ``num2epoch`` and ``epoch2num`` +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +These two functions were deprecated in 3.3.0, and did not return +an accurate Matplotlib datenum relative to the new Matplotlib epoch +handling (`~.dates.get_epoch` and :rc:`date.epoch`). This version +reverts the deprecation. + +Functions ``epoch2num`` and ``dates.julian2num`` use ``date.epoch`` rcParam +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Now `~.dates.epoch2num` and (undocumented) ``julian2num`` return floating point +days since `~.dates.get_epoch` as set by :rc:`date.epoch`, instead of +floating point days since the old epoch of "0000-12-31T00:00:00". If +needed, you can translate from the new to old values as +``old = new + mdates.date2num(np.datetime64('0000-12-31'))`` diff --git a/doc/api/next_api_changes/deprecations/18002-AL.rst b/doc/api/next_api_changes/deprecations/18002-AL.rst new file mode 100644 index 000000000000..a61429712401 --- /dev/null +++ b/doc/api/next_api_changes/deprecations/18002-AL.rst @@ -0,0 +1,11 @@ +Deprecation of various mathtext helpers +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +The ``MathtextBackendPdf``, ``MathtextBackendPs``, ``MathtextBackendSvg``, +and ``MathtextBackendCairo`` classes from the :mod:`.mathtext` module, as +well as the corresponding ``.mathtext_parser`` attributes on ``RendererPdf``, +``RendererPS``, ``RendererSVG``, and ``RendererCairo``, are deprecated. The +``MathtextBackendPath`` class can be used to obtain a list of glyphs and +rectangles in a mathtext expression, and renderer-specific logic should be +directly implemented in the renderer. + +``StandardPsFonts.pswriter`` is unused and deprecated. diff --git a/doc/api/next_api_changes/deprecations/18003-AL.rst b/doc/api/next_api_changes/deprecations/18003-AL.rst new file mode 100644 index 000000000000..c5c941e784ca --- /dev/null +++ b/doc/api/next_api_changes/deprecations/18003-AL.rst @@ -0,0 +1,3 @@ +mathtext.Fonts.destroy +~~~~~~~~~~~~~~~~~~~~~~ +... is deprecated, because Fonts do not create reference loops anyways. diff --git a/doc/api/next_api_changes/deprecations/18004-AL.rst b/doc/api/next_api_changes/deprecations/18004-AL.rst new file mode 100644 index 000000000000..360a8ba33bee --- /dev/null +++ b/doc/api/next_api_changes/deprecations/18004-AL.rst @@ -0,0 +1,4 @@ +*facename* parameter of `.mathtext.Fonts.render_glyph` +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +This parameter was renamed to *font* for consistency with the rest of the +`.Fonts` API. diff --git a/doc/api/next_api_changes/development/00001-ABC.rst b/doc/api/next_api_changes/development/00001-ABC.rst new file mode 100644 index 000000000000..4c60d3db185b --- /dev/null +++ b/doc/api/next_api_changes/development/00001-ABC.rst @@ -0,0 +1,7 @@ +Development Change template +~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Enter description here.... + +Please rename file with PR number and your initials i.e. "99999-ABC.rst" +and ``git add`` the new file. diff --git a/doc/api/next_api_changes/removals/00001-ABC.rst b/doc/api/next_api_changes/removals/00001-ABC.rst new file mode 100644 index 000000000000..5c68eda9698a --- /dev/null +++ b/doc/api/next_api_changes/removals/00001-ABC.rst @@ -0,0 +1,7 @@ +Removal Change template +~~~~~~~~~~~~~~~~~~~~~~~ + +Enter description of methods/classes removed here.... + +Please rename file with PR number and your initials i.e. "99999-ABC.rst" +and ``git add`` the new file. diff --git a/doc/api/next_api_changes/removals/18069.DS.rst b/doc/api/next_api_changes/removals/18069.DS.rst new file mode 100644 index 000000000000..f55bf30bbd07 --- /dev/null +++ b/doc/api/next_api_changes/removals/18069.DS.rst @@ -0,0 +1,5 @@ +Removed support for single color strings in `~.colors.to_rgba_array` +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Converting a string with single color characters (e.g. ``'cymk'``) in +`~.colors.to_rgba_array` is no longer supported. Instead, the colors can be +passed individually in a list (e.g. ``['c', 'y', 'm', 'k']``). diff --git a/doc/api/next_api_changes/removals/18070-DS.rst b/doc/api/next_api_changes/removals/18070-DS.rst new file mode 100644 index 000000000000..d6bbe3f86263 --- /dev/null +++ b/doc/api/next_api_changes/removals/18070-DS.rst @@ -0,0 +1,15 @@ +`.rcsetup` removals +~~~~~~~~~~~~~~~~~~~ +The following functions in `matplotlib.rcsetup` have been removed: + +- ``validate_path_exists`` - use `os.path.exists` instead. +- ``update_savefig_format`` - this just replaced ``'auto'`` with ``'png'``. +- ``validate_animation_writer_path``. + +Changes to valid rcParams +~~~~~~~~~~~~~~~~~~~~~~~~~ +The following rcParam values are no longer valid: + +- Setting :rc:`savefig.format` to ``"auto"`` - use ``"png"`` instead. +- Seeting :rc:`boxplot.whiskers` to ``"range"`` - set it to ``0, 100`` instead. +- Setting :rc:`text.hinting` to `False` or `True` - set it to ``"auto"`` or ``"none"`` respectively. diff --git a/doc/api/next_api_changes/removals/18071-DS.rst b/doc/api/next_api_changes/removals/18071-DS.rst new file mode 100644 index 000000000000..b3895d909bd9 --- /dev/null +++ b/doc/api/next_api_changes/removals/18071-DS.rst @@ -0,0 +1,9 @@ +`matplotlib.animation` +~~~~~~~~~~~~~~~~~~~~~~ + +The following `~.animation.MovieWriterRegistry` methods have been removed: + +- ``.set_dirty()`` - does nothing. +- ``.ensure_not_dirty()`` - does nothing. +- ``.reset_available_writers()`` - does nothing. +- ``.avail()`` - use ``.list()`` instead to get a list of available writers. diff --git a/doc/api/next_api_changes/removals/18073-DS.rst b/doc/api/next_api_changes/removals/18073-DS.rst new file mode 100644 index 000000000000..015ba418ffd6 --- /dev/null +++ b/doc/api/next_api_changes/removals/18073-DS.rst @@ -0,0 +1,5 @@ +``matplotlib.testing.disable_internet`` +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +The entire ``matplotlib.testing.disable_internet`` sub-module has been removed. +The `pytest-remotedata package `_ +can be used instead. diff --git a/doc/api/prev_api_changes/api_changes_3.1.0.rst b/doc/api/prev_api_changes/api_changes_3.1.0.rst index 90d4fc3548bd..2c0f629729db 100644 --- a/doc/api/prev_api_changes/api_changes_3.1.0.rst +++ b/doc/api/prev_api_changes/api_changes_3.1.0.rst @@ -531,7 +531,11 @@ The following miscellaneous API elements have been removed import logging logger = logging.getLogger('matplotlib') - logger.set_level(logging.INFO) + logger.setLevel(logging.INFO) + # configure log handling: Either include it into your ``logging`` hierarchy, + # e.g. by configuring a root looger using ``logging.basicConfig()``, + # or add a standalone handler to the matplotlib logger: + logger.addHandler(logging.StreamHandler()) - ``__version__numpy__`` - ``collections.CIRCLE_AREA_FACTOR`` diff --git a/doc/api/prev_api_changes/api_changes_3.2.0/behavior.rst b/doc/api/prev_api_changes/api_changes_3.2.0/behavior.rst index 52103b625a09..7a95a391ad1a 100644 --- a/doc/api/prev_api_changes/api_changes_3.2.0/behavior.rst +++ b/doc/api/prev_api_changes/api_changes_3.2.0/behavior.rst @@ -293,7 +293,7 @@ Exception changes Various APIs that raised a `ValueError` for incorrectly typed inputs now raise `TypeError` instead: `.backend_bases.GraphicsContextBase.set_clip_path`, `.blocking_input.BlockingInput.__call__`, `.cm.register_cmap`, `.dviread.DviFont`, -`.rcsetup.validate_hatch`, `.rcsetup.validate_animation_writer_path`, `.spines.Spine`, +`.rcsetup.validate_hatch`, ``.rcsetup.validate_animation_writer_path``, `.spines.Spine`, many classes in the :mod:`matplotlib.transforms` module and :mod:`matplotlib.tri` package, and Axes methods that take a ``norm`` parameter. diff --git a/doc/api/prev_api_changes/api_changes_3.3.0.rst b/doc/api/prev_api_changes/api_changes_3.3.0.rst new file mode 100644 index 000000000000..bbe676a4ec52 --- /dev/null +++ b/doc/api/prev_api_changes/api_changes_3.3.0.rst @@ -0,0 +1,14 @@ +API Changes for 3.3.0 +===================== + +.. contents:: + :local: + :depth: 1 + +.. include:: /api/prev_api_changes/api_changes_3.3.0/behaviour.rst + +.. include:: /api/prev_api_changes/api_changes_3.3.0/deprecations.rst + +.. include:: /api/prev_api_changes/api_changes_3.3.0/removals.rst + +.. include:: /api/prev_api_changes/api_changes_3.3.0/development.rst diff --git a/doc/api/api_changes_3.3/behaviour.rst b/doc/api/prev_api_changes/api_changes_3.3.0/behaviour.rst similarity index 90% rename from doc/api/api_changes_3.3/behaviour.rst rename to doc/api/prev_api_changes/api_changes_3.3.0/behaviour.rst index d8a9e377b4d9..2b21794ede6b 100644 --- a/doc/api/api_changes_3.3/behaviour.rst +++ b/doc/api/prev_api_changes/api_changes_3.3.0/behaviour.rst @@ -96,9 +96,10 @@ internal quotes) now cause a ValueError to be raised. `.SymLogNorm` now has a *base* parameter ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -Previously, `.SymLogNorm` had no *base* kwarg, and defaulted to ``base=np.e`` -whereas the documentation said it was ``base=10``. In preparation to make -the default 10, calling `.SymLogNorm` without the new *base* kwarg emits a +Previously, `.SymLogNorm` had no *base* keyword argument, and +defaulted to ``base=np.e`` whereas the documentation said it was +``base=10``. In preparation to make the default 10, calling +`.SymLogNorm` without the new *base* keyword argument emits a deprecation warning. @@ -181,8 +182,8 @@ explicitly pass a "%1.2f" as the *valfmt* parameter to `.Slider`. Add *normalize* keyword argument to ``Axes.pie`` ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -``pie()`` used to draw a partial pie if the sum of the values was < 1. This behavior -is deprecated and will change to always normalizing the values to a full pie by default. +``pie()`` used to draw a partial pie if the sum of the values was < 1. This behavior +is deprecated and will change to always normalizing the values to a full pie by default. If you want to draw a partial pie, please pass ``normalize=False`` explicitly. ``table.CustomCell`` is now an alias for `.table.Cell` @@ -307,3 +308,34 @@ but will become True in a later release. ... to determine whether a string should be passed to the usetex machinery or not. This allows single strings to be marked as not-usetex even when the rcParam is True. + +`.Axes.vlines`, `.Axes.hlines`, `.pyplot.vlines` and `.pyplot.hlines` *colors* parameter default change +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +The *colors* parameter will now default to :rc:`lines.color`, while previously it defaulted to 'k'. + +Aggressively autoscale clim in ``ScalerMappable`` classes +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + +Previously some plotting methods would defer autoscaling until the +first draw if only one of the *vmin* or *vmax* keyword arguments were +passed (`.Axes.scatter`, `.Axes.hexbin`, `.Axes.imshow`, +`.Axes.pcolorfast`) but would scale based on the passed data if +neither was passed (independent of the *norm* keyword arguments). +Other methods (`.Axes.pcolor`, `.Axes.pcolormesh`) always autoscaled +base on the initial data. + +All of the plotting methods now resolve the unset *vmin* or *vmax* +at the initial call time using the data passed in. + +If you were relying on exactly one of the *vmin* or *vmax* remaining +unset between the time when the method is called and the first time +the figure is rendered you get back the old behavior by manually setting +the relevant limit back to `None` :: + + cm_obj.norm.vmin = None + # or + cm_obj.norm.vmax = None + +which will be resolved during the draw process. diff --git a/doc/api/api_changes_3.3/deprecations.rst b/doc/api/prev_api_changes/api_changes_3.3.0/deprecations.rst similarity index 95% rename from doc/api/api_changes_3.3/deprecations.rst rename to doc/api/prev_api_changes/api_changes_3.3.0/deprecations.rst index 1d5778d7206a..4eb73b16dd54 100644 --- a/doc/api/api_changes_3.3/deprecations.rst +++ b/doc/api/prev_api_changes/api_changes_3.3.0/deprecations.rst @@ -445,7 +445,9 @@ This method is deprecated. Use the ``GridSpec.nrows``, ``GridSpec.ncols``, Qt4-based backends ~~~~~~~~~~~~~~~~~~ -The qt4agg and qt4cairo backends are deprecated. +The qt4agg and qt4cairo backends are deprecated. Qt4 has reached its +end-of-life in 2015 and there are no releases for recent versions of Python. +Please consider switching to Qt5. *fontdict* and *minor* parameters of `.Axes.set_xticklabels` and `.Axes.set_yticklabels` will become keyword-only ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -589,3 +591,32 @@ implementers). Passing ``ismath="TeX!"`` to `.RendererAgg.get_text_width_height_descent` is deprecated. Pass ``ismath="TeX"`` instead, consistently with other low-level APIs which support the values True, False, and "TeX" for ``ismath``. + +``matplotlib.ttconv`` +~~~~~~~~~~~~~~~~~~~~~ +This module is deprecated. + + +Stricter PDF metadata keys in PGF +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Saving metadata in PDF with the PGF backend currently normalizes all keys to +lowercase, unlike the PDF backend, which only accepts the canonical case. This +is deprecated; in a future version, only the canonically cased keys listed in +the PDF specification (and the `~.backend_pgf.PdfPages` documentation) will be +accepted. + + +Qt modifier keys +~~~~~~~~~~~~~~~~ +The ``MODIFIER_KEYS``, ``SUPER``, ``ALT``, ``CTRL``, and ``SHIFT`` +global variables of the :mod:`matplotlib.backends.backend_qt4agg`, +:mod:`matplotlib.backends.backend_qt4cairo`, +:mod:`matplotlib.backends.backend_qt5agg` and +:mod:`matplotlib.backends.backend_qt5cairo` modules are deprecated. + +``TexManager`` +~~~~~~~~~~~~~~ + +The ``TexManager.serif``, ``TexManager.sans_serif``, +``TexManager.cursive`` and ``TexManager.monospace`` attributes are +deprecated. diff --git a/doc/api/api_changes_3.3/development.rst b/doc/api/prev_api_changes/api_changes_3.3.0/development.rst similarity index 100% rename from doc/api/api_changes_3.3/development.rst rename to doc/api/prev_api_changes/api_changes_3.3.0/development.rst diff --git a/doc/api/api_changes_3.3/removals.rst b/doc/api/prev_api_changes/api_changes_3.3.0/removals.rst similarity index 100% rename from doc/api/api_changes_3.3/removals.rst rename to doc/api/prev_api_changes/api_changes_3.3.0/removals.rst diff --git a/doc/api/tri_api.rst b/doc/api/tri_api.rst index 67db3068d46b..9205e34ff93b 100644 --- a/doc/api/tri_api.rst +++ b/doc/api/tri_api.rst @@ -7,6 +7,9 @@ .. autoclass:: matplotlib.tri.Triangulation :members: +.. autoclass:: matplotlib.tri.TriContourSet + :show-inheritance: + .. autoclass:: matplotlib.tri.TriFinder .. autoclass:: matplotlib.tri.TrapezoidMapTriFinder diff --git a/doc/citing.rst b/doc/citing.rst index b267bf845197..325156219f1c 100644 --- a/doc/citing.rst +++ b/doc/citing.rst @@ -27,93 +27,110 @@ pp. 90-95, 2007 `_. DOIs ---- + +The following DOI represents *all* Matplotlib versions. Please select a more +specific DOI from the list below, referring to the version used for your publication. + + .. image:: https://zenodo.org/badge/DOI/10.5281/zenodo.592536.svg + :target: https://doi.org/10.5281/zenodo.592536 + +By version +~~~~~~~~~~ +.. START OF AUTOGENERATED + + +v3.2.2 + .. image:: https://zenodo.org/badge/DOI/10.5281/zenodo.3898017.svg + :target: https://doi.org/10.5281/zenodo.3898017 v3.2.1 - .. image:: https://zenodo.org/badge/DOI/10.5281/zenodo.3714460.svg - :target: https://doi.org/10.5281/zenodo.3714460 + .. image:: _static/zenodo_cache/3714460.svg + :target: https://doi.org/10.5281/zenodo.3714460 v3.2.0 - .. image:: https://zenodo.org/badge/DOI/10.5281/zenodo.3695547.svg - :target: https://doi.org/10.5281/zenodo.3695547 + .. image:: _static/zenodo_cache/3695547.svg + :target: https://doi.org/10.5281/zenodo.3695547 v3.1.3 - .. image:: https://zenodo.org/badge/DOI/10.5281/zenodo.3633844.svg - :target: https://doi.org/10.5281/zenodo.3633844 + .. image:: _static/zenodo_cache/3633844.svg + :target: https://doi.org/10.5281/zenodo.3633844 v3.1.2 - .. image:: https://zenodo.org/badge/DOI/10.5281/zenodo.3563226.svg - :target: https://doi.org/10.5281/zenodo.3563226 + .. image:: _static/zenodo_cache/3563226.svg + :target: https://doi.org/10.5281/zenodo.3563226 v3.1.1 - .. image:: https://zenodo.org/badge/DOI/10.5281/zenodo.3264781.svg - :target: https://doi.org/10.5281/zenodo.3264781 + .. image:: _static/zenodo_cache/3264781.svg + :target: https://doi.org/10.5281/zenodo.3264781 v3.1.0 - .. image:: https://zenodo.org/badge/DOI/10.5281/zenodo.2893252.svg - :target: https://doi.org/10.5281/zenodo.2893252 + .. image:: _static/zenodo_cache/2893252.svg + :target: https://doi.org/10.5281/zenodo.2893252 v3.0.3 - .. image:: https://zenodo.org/badge/DOI/10.5281/zenodo.2577644.svg - :target: https://doi.org/10.5281/zenodo.2577644 + .. image:: _static/zenodo_cache/2577644.svg + :target: https://doi.org/10.5281/zenodo.2577644 v3.0.2 - .. image:: https://zenodo.org/badge/DOI/10.5281/zenodo.1482099.svg - :target: https://doi.org/10.5281/zenodo.1482099 + .. image:: _static/zenodo_cache/1482099.svg + :target: https://doi.org/10.5281/zenodo.1482099 v3.0.1 - .. image:: https://zenodo.org/badge/DOI/10.5281/zenodo.1482098.svg - :target: https://doi.org/10.5281/zenodo.1482098 + .. image:: _static/zenodo_cache/1482098.svg + :target: https://doi.org/10.5281/zenodo.1482098 v2.2.5 - .. image:: https://zenodo.org/badge/DOI/10.5281/zenodo.3633833.svg - :target: https://doi.org/10.5281/zenodo.3633833 + .. image:: _static/zenodo_cache/3633833.svg + :target: https://doi.org/10.5281/zenodo.3633833 v3.0.0 - .. image:: https://zenodo.org/badge/DOI/10.5281/zenodo.1420605.svg - :target: https://doi.org/10.5281/zenodo.1420605 + .. image:: _static/zenodo_cache/1420605.svg + :target: https://doi.org/10.5281/zenodo.1420605 v2.2.4 - .. image:: https://zenodo.org/badge/DOI/10.5281/zenodo.2669103.svg - :target: https://doi.org/10.5281/zenodo.2669103 + .. image:: _static/zenodo_cache/2669103.svg + :target: https://doi.org/10.5281/zenodo.2669103 v2.2.3 - .. image:: https://zenodo.org/badge/DOI/10.5281/zenodo.1343133.svg - :target: https://doi.org/10.5281/zenodo.1343133 + .. image:: _static/zenodo_cache/1343133.svg + :target: https://doi.org/10.5281/zenodo.1343133 v2.2.2 - .. image:: https://zenodo.org/badge/DOI/10.5281/zenodo.1202077.svg - :target: https://doi.org/10.5281/zenodo.1202077 + .. image:: _static/zenodo_cache/1202077.svg + :target: https://doi.org/10.5281/zenodo.1202077 v2.2.1 - .. image:: https://zenodo.org/badge/DOI/10.5281/zenodo.1202050.svg - :target: https://doi.org/10.5281/zenodo.1202050 + .. image:: _static/zenodo_cache/1202050.svg + :target: https://doi.org/10.5281/zenodo.1202050 v2.2.0 - .. image:: https://zenodo.org/badge/DOI/10.5281/zenodo.1189358.svg - :target: https://doi.org/10.5281/zenodo.1189358 + .. image:: _static/zenodo_cache/1189358.svg + :target: https://doi.org/10.5281/zenodo.1189358 v2.1.2 - .. image:: https://zenodo.org/badge/DOI/10.5281/zenodo.1154287.svg - :target: https://doi.org/10.5281/zenodo.1154287 + .. image:: _static/zenodo_cache/1154287.svg + :target: https://doi.org/10.5281/zenodo.1154287 v2.1.1 - .. image:: https://zenodo.org/badge/DOI/10.5281/zenodo.1098480.svg - :target: https://doi.org/10.5281/zenodo.1098480 + .. image:: _static/zenodo_cache/1098480.svg + :target: https://doi.org/10.5281/zenodo.1098480 v2.1.0 - .. image:: https://zenodo.org/badge/doi/10.5281/zenodo.1004650.svg - :target: https://doi.org/10.5281/zenodo.1004650 + .. image:: _static/zenodo_cache/1004650.svg + :target: https://doi.org/10.5281/zenodo.1004650 v2.0.2 - .. image:: https://zenodo.org/badge/doi/10.5281/zenodo.573577.svg - :target: https://doi.org/10.5281/zenodo.573577 + .. image:: _static/zenodo_cache/573577.svg + :target: https://doi.org/10.5281/zenodo.573577 v2.0.1 - .. image:: https://zenodo.org/badge/doi/10.5281/zenodo.570311.svg - :target: https://doi.org/10.5281/zenodo.570311 + .. image:: _static/zenodo_cache/570311.svg + :target: https://doi.org/10.5281/zenodo.570311 v2.0.0 - .. image:: https://zenodo.org/badge/doi/10.5281/zenodo.248351.svg - :target: https://doi.org/10.5281/zenodo.248351 + .. image:: _static/zenodo_cache/248351.svg + :target: https://doi.org/10.5281/zenodo.248351 v1.5.3 - .. image:: https://zenodo.org/badge/doi/10.5281/zenodo.61948.svg - :target: https://doi.org/10.5281/zenodo.61948 + .. image:: _static/zenodo_cache/61948.svg + :target: https://doi.org/10.5281/zenodo.61948 v1.5.2 - .. image:: https://zenodo.org/badge/doi/10.5281/zenodo.56926.svg - :target: https://doi.org/10.5281/zenodo.56926 + .. image:: _static/zenodo_cache/56926.svg + :target: https://doi.org/10.5281/zenodo.56926 v1.5.1 - .. image:: https://zenodo.org/badge/doi/10.5281/zenodo.44579.svg - :target: https://doi.org/10.5281/zenodo.44579 + .. image:: _static/zenodo_cache/44579.svg + :target: https://doi.org/10.5281/zenodo.44579 v1.5.0 - .. image:: https://zenodo.org/badge/doi/10.5281/zenodo.32914.svg - :target: https://doi.org/10.5281/zenodo.32914 + .. image:: _static/zenodo_cache/32914.svg + :target: https://doi.org/10.5281/zenodo.32914 v1.4.3 - .. image:: https://zenodo.org/badge/doi/10.5281/zenodo.15423.svg - :target: https://doi.org/10.5281/zenodo.15423 + .. image:: _static/zenodo_cache/15423.svg + :target: https://doi.org/10.5281/zenodo.15423 v1.4.2 - .. image:: https://zenodo.org/badge/doi/10.5281/zenodo.12400.svg - :target: https://doi.org/10.5281/zenodo.12400 + .. image:: _static/zenodo_cache/12400.svg + :target: https://doi.org/10.5281/zenodo.12400 v1.4.1 - .. image:: https://zenodo.org/badge/doi/10.5281/zenodo.12287.svg - :target: https://doi.org/10.5281/zenodo.12287 + .. image:: _static/zenodo_cache/12287.svg + :target: https://doi.org/10.5281/zenodo.12287 v1.4.0 - .. image:: https://zenodo.org/badge/doi/10.5281/zenodo.11451.svg - :target: https://doi.org/10.5281/zenodo.11451 + .. image:: _static/zenodo_cache/11451.svg + :target: https://doi.org/10.5281/zenodo.11451 + +.. END OF AUTOGENERATED diff --git a/doc/conf.py b/doc/conf.py index 5e4523212c05..7da2dc80df6a 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -48,6 +48,7 @@ 'sphinx_gallery.gen_gallery', 'matplotlib.sphinxext.mathmpl', 'matplotlib.sphinxext.plot_directive', + 'sphinxcontrib.inkscapeconverter', 'sphinxext.custom_roles', 'sphinxext.github', 'sphinxext.math_symbol_table', @@ -57,7 +58,11 @@ 'sphinx_copybutton', ] -exclude_patterns = ['api/api_changes/*', 'users/whats_new/*'] +exclude_patterns = [ + 'api/prev_api_changes/api_changes_*/*', + # Be sure to update users/whats_new.rst: + 'users/prev_whats_new/whats_new_3.3.0.rst', +] def _check_dependencies(): @@ -69,6 +74,7 @@ def _check_dependencies(): "PIL.Image": 'pillow', "sphinx_copybutton": 'sphinx_copybutton', "sphinx_gallery": 'sphinx_gallery', + "sphinxcontrib.inkscapeconverter": 'sphinxcontrib-svg2pdfconverter', } missing = [] for name in names: @@ -112,13 +118,13 @@ def _check_dependencies(): intersphinx_mapping = { 'Pillow': ('https://pillow.readthedocs.io/en/stable/', None), - 'cycler': ('https://matplotlib.org/cycler', None), + 'cycler': ('https://matplotlib.org/cycler/', None), 'dateutil': ('https://dateutil.readthedocs.io/en/stable/', None), 'ipykernel': ('https://ipykernel.readthedocs.io/en/latest/', None), - 'numpy': ('https://docs.scipy.org/doc/numpy/', None), + 'numpy': ('https://numpy.org/doc/stable/', None), 'pandas': ('https://pandas.pydata.org/pandas-docs/stable/', None), - 'pytest': ('https://pytest.org/en/stable', None), - 'python': ('https://docs.python.org/3', None), + 'pytest': ('https://pytest.org/en/stable/', None), + 'python': ('https://docs.python.org/3/', None), 'scipy': ('https://docs.scipy.org/doc/scipy/reference/', None), } @@ -131,14 +137,15 @@ def _check_dependencies(): 'doc_module': ('matplotlib', 'mpl_toolkits'), 'reference_url': { 'matplotlib': None, - 'numpy': 'https://docs.scipy.org/doc/numpy', - 'scipy': 'https://docs.scipy.org/doc/scipy/reference', + 'numpy': 'https://docs.scipy.org/doc/numpy/', + 'scipy': 'https://docs.scipy.org/doc/scipy/reference/', }, 'backreferences_dir': 'api/_as_gen', 'subsection_order': gallery_order.sectionorder, 'within_subsection_order': gallery_order.subsectionorder, 'remove_config_comments': True, 'min_reported_time': 1, + 'thumbnail_size': (320, 224), 'compress_images': ('thumbnails', 'images'), 'matplotlib_animations': True, } @@ -375,7 +382,9 @@ def _check_dependencies(): inheritance_node_attrs = dict(fontsize=16) graphviz_dot = shutil.which('dot') -graphviz_output_format = 'svg' +# Still use PNG until SVG linking is fixed +# https://github.com/sphinx-doc/sphinx/issues/3176 +# graphviz_output_format = 'svg' def setup(app): diff --git a/doc/devel/MEP/MEP11.rst b/doc/devel/MEP/MEP11.rst index 3104f75e9d51..9ddd0109c06b 100644 --- a/doc/devel/MEP/MEP11.rst +++ b/doc/devel/MEP/MEP11.rst @@ -127,21 +127,21 @@ dateutil_. For binary installations, there are a number of alternatives (here ordered from best/hardest to worst/easiest): - 1. The distutils wininst installer allows a post-install script to - run. It might be possible to get this script to run pip_ to - install the other dependencies. (See `this thread - `_ - for someone who has trod that ground before). - - 2. Continue to ship dateutil_, pytz_, six_ and pyparsing_ in - our installer, but use the post-install-script to install them - *only* if they can not already be found. - - 3. Move all of these packages inside a (new) ``matplotlib.extern`` - namespace so it is clear for outside users that these are - external packages. Add some conditional imports in the core - matplotlib codebase so dateutil_ (at the top-level) is tried - first, and failing that ``matplotlib.extern.dateutil`` is used. +1. The distutils wininst installer allows a post-install script to + run. It might be possible to get this script to run pip_ to + install the other dependencies. (See `this thread + `_ + for someone who has trod that ground before). + +2. Continue to ship dateutil_, pytz_, six_ and pyparsing_ in + our installer, but use the post-install-script to install them + *only* if they can not already be found. + +3. Move all of these packages inside a (new) ``matplotlib.extern`` + namespace so it is clear for outside users that these are + external packages. Add some conditional imports in the core + matplotlib codebase so dateutil_ (at the top-level) is tried + first, and failing that ``matplotlib.extern.dateutil`` is used. 2 and 3 are undesirable as they still require maintaining copies of these packages in our tree -- and this is exacerbated by the fact that diff --git a/doc/devel/coding_guide.rst b/doc/devel/coding_guide.rst index ccb7cde94042..cced9549aaf3 100644 --- a/doc/devel/coding_guide.rst +++ b/doc/devel/coding_guide.rst @@ -1,5 +1,3 @@ -.. _pr-guidelines: - .. raw:: html +.. _pr-guidelines: + *********************** Pull request guidelines *********************** @@ -110,8 +110,9 @@ Documentation :file:`doc/users/whats_new.rst`. * If you change the API in a backward-incompatible way, please - document it in the relevant file in most recent - :file:`doc/api/api_changes_X.Y`. + document it by adding a file in the relevant subdirectory of + :file:`doc/api/next_api_changes/`, probably in the ``behavior/`` + subdirectory. .. _pr-labels: @@ -163,9 +164,9 @@ Merging approve the review and if you think no more review is needed, merge the PR. - Ensure that all API changes are documented in the relevant file in - the most recent :file:`doc/api/api_changes_X.Y` and significant new features - have an entry in :file:`doc/user/whats_new`. + Ensure that all API changes are documented in a file in one of the + subdirectories of :file:`doc/api/next_api_changes`, and significant new + features have an entry in :file:`doc/user/whats_new`. - If a PR already has a positive review, a core developer (e.g. the first reviewer, but not necessarily) may champion that PR for merging. In order @@ -254,7 +255,7 @@ The current active branches are *master* The current development version. Future minor releases (*v3.N.0*) will be - branched from this. Supports Python 3.6+. + branched from this. Supports Python 3.7+. *v3.N.x* Maintenance branch for Matplotlib 3.N. Future patch releases will be diff --git a/doc/devel/contributing.rst b/doc/devel/contributing.rst index d32eb0ebdbfe..23bca8c7fb67 100644 --- a/doc/devel/contributing.rst +++ b/doc/devel/contributing.rst @@ -17,8 +17,8 @@ Submitting a bug report If you find a bug in the code or documentation, do not hesitate to submit a ticket to the -`Bug Tracker `_. You are also -welcome to post feature requests or pull requests. +`Issue Tracker `_. You are +also welcome to post feature requests or pull requests. If you are reporting a bug, please do your best to include the following: @@ -48,6 +48,17 @@ use to organize this information. Thank you for your help in keeping bug reports complete, targeted and descriptive. +Requesting a new feature +======================== + +Please post feature requests to the +`Issue Tracker `_. + +The Matplotlib developers will give feedback on the feature proposal. Since +Matplotlib is an open source project with limited resources, we encourage +users to then also +:ref:`participate in the implementation `. + .. _installing_for_devs: Retrieving and installing the latest version of the code @@ -123,6 +134,7 @@ You can then run the tests to check your work environment is set up properly:: * :ref:`testing` +.. _contributing-code: Contributing code ================= @@ -227,8 +239,10 @@ rules before submitting a pull request: :file:`doc/users/next_whats_new/README.rst` for more information). * If you change the API in a backward-incompatible way, please document it in - :file:`doc/api/api_changes`, by adding to the relevant file - (see :file:`doc/api/api_changes.rst` for more information) + :file:`doc/api/next_api_changes/behavior`, by adding a new file with the + naming convention ``99999-ABC.rst`` where the pull request number is followed + by the contributor's initials. (see :file:`doc/api/api_changes.rst` for more + information) * See below for additional points about :ref:`keyword-argument-processing`, if applicable for your pull request. @@ -317,8 +331,10 @@ API changes Changes to the public API must follow a standard deprecation procedure to prevent unexpected breaking of code that uses Matplotlib. -- Deprecations must be announced via an entry in - the most recent :file:`doc/api/api_changes_X.Y` +- Deprecations must be announced via a new file in + a new file in :file:`doc/api/next_api_changes/deprecations/` with + naming convention ``99999-ABC.rst`` where ``99999`` is the pull request + number and ``ABC`` are the contributor's initials. - Deprecations are targeted at the next point-release (i.e. 3.x.0). - The deprecated API should, to the maximum extent possible, remain fully functional during the deprecation period. In cases where this is not @@ -393,7 +409,7 @@ function is a simple pass-through to # in pylab.py def text(*args, **kwargs): - ret = gca().text(*args, **kwargs) + ret = gca().text(*args, **kwargs) draw_if_interactive() return ret @@ -411,7 +427,7 @@ illustration) just passes them on to the # in text.py def __init__(self, x=0, y=0, text='', **kwargs): - Artist.__init__(self) + super().__init__() self.update(kwargs) ``update`` does the work looking for methods named like diff --git a/doc/devel/documenting_mpl.rst b/doc/devel/documenting_mpl.rst index 857f6f8a350e..575641a4c53d 100644 --- a/doc/devel/documenting_mpl.rst +++ b/doc/devel/documenting_mpl.rst @@ -111,6 +111,12 @@ it, use .. code-block:: sh make SPHINXOPTS= html + +On Windows the arguments must be at the end of the statement: + +.. code-block:: bat + + make html SPHINXOPTS= You can use the ``O`` variable to set additional options: @@ -121,8 +127,12 @@ You can use the ``O`` variable to set additional options: Multiple options can be combined using e.g. ``make O='-j4 -Dplot_gallery=0' html``. -On Windows, options needs to be set as environment variables, e.g. ``set O=-W ---keep-going -j4 & make html``. +On Windows, either use the format shown above or set options as environment variables, e.g.: + +.. code-block:: bat + + set O=-W --keep-going -j4 + make html .. _writing-rest-pages: diff --git a/doc/devel/index.rst b/doc/devel/index.rst index 9ee547178ae4..ea83129824c1 100644 --- a/doc/devel/index.rst +++ b/doc/devel/index.rst @@ -4,10 +4,14 @@ The Matplotlib Developers' Guide ################################ -.. only:: html +.. raw:: html - :Release: |version| - :Date: |today| +
+ Report a bug + Request a feature + Contribute code + Write documentation +
.. toctree:: :maxdepth: 2 diff --git a/doc/devel/min_dep_policy.rst b/doc/devel/min_dep_policy.rst index e4921a756018..45cee59e34a3 100644 --- a/doc/devel/min_dep_policy.rst +++ b/doc/devel/min_dep_policy.rst @@ -83,7 +83,8 @@ specification of the dependencies. ========== ======== ====== Matplotlib Python NumPy ========== ======== ====== -3.3 3.6 1.15.0 +3.4 3.7 1.16.0 +`3.3`_ 3.6 1.15.0 `3.2`_ 3.6 1.11.0 `3.1`_ 3.6 1.11.0 `3.0`_ 3.5 1.10.0 @@ -98,6 +99,7 @@ Matplotlib Python NumPy 1.0 2.4 1.1 ========== ======== ====== +.. _`3.3`: https://matplotlib.org/3.3.0/users/installing.html#dependencies .. _`3.2`: https://matplotlib.org/3.2.0/users/installing.html#dependencies .. _`3.1`: https://matplotlib.org/3.1.0/users/installing.html#dependencies .. _`3.0`: https://matplotlib.org/3.0.0/users/installing.html#dependencies diff --git a/doc/devel/release_guide.rst b/doc/devel/release_guide.rst index aac6fe5438fc..aac4650855ff 100644 --- a/doc/devel/release_guide.rst +++ b/doc/devel/release_guide.rst @@ -112,7 +112,7 @@ For the "what's new", Similarly for the "API changes", 1. copy the current api changes to a file is :file:`doc/api/prev_api_changes` - 2. merge all of the files in the most recent :file:`doc/api/api_changes_X.Y` + 2. merge all of the files in the most recent :file:`doc/api/next_api_changes` into :file:`doc/api/api_changes.rst` 3. comment out the most recent API changes at the top. @@ -219,12 +219,22 @@ Via the `GitHub UI pushed tag into a release. If this is a pre-release remember to mark it as such. -For final releases, also get the DOI from `zenodo `__ -(which will automatically produce one once the tag is pushed), add the DOI link -to :file:`doc/citing.rst`, commit to the VER-doc branch and push to GitHub :: +For final releases, also get the DOI from `zenodo +`__ (which will automatically produce one once +the tag is pushed). Add the doi post-fix and version to the dictionary in +:file:`tools/cache_zenodo_svg.py` and run the script. + + +This will download the new svg to the :file:`_static` directory in the +docs and edit :file:`doc/citing.rst`. Commit the new svg, the change +to :file:`tools/cache_zenodo_svg.py`, and the changes to +:file:`doc/citing.rst` to the VER-doc branch and push to GitHub. :: git checkout v2.0.0-doc + $EDITOR tools/cache_zenodo_svg.py + python tools/cache_zenodo_svg.py $EDITOR doc/citing.html + git commit -a git push DANGER v2.0.0-doc:v2.0.0-doc .. _release_bld_bin: diff --git a/doc/devel/testing.rst b/doc/devel/testing.rst index d1187d3ecfb1..2fc16c57122d 100644 --- a/doc/devel/testing.rst +++ b/doc/devel/testing.rst @@ -243,7 +243,7 @@ You can also run tox on a subset of environments: .. code-block:: bash - $ tox -e py36,py37 + $ tox -e py37,py38 Tox processes everything serially so it can take a long time to test several environments. To speed it up, you might try using a new, diff --git a/doc/faq/howto_faq.rst b/doc/faq/howto_faq.rst index 52dbe45b52ab..0b43bf9db96a 100644 --- a/doc/faq/howto_faq.rst +++ b/doc/faq/howto_faq.rst @@ -532,42 +532,6 @@ most GUI backends *require* being run from the main thread as well. How-to: Contributing ==================== -.. _how-to-request-feature: - -Request a new feature ---------------------- - -Is there a feature you wish Matplotlib had? Then ask! The best -way to get started is to email the developer `mailing -list `_ for discussion. -This is an open source project developed primarily in the -contributors free time, so there is no guarantee that your -feature will be added. The *best* way to get the feature -you need added is to contribute it your self. - -.. _how-to-submit-patch: - -Reporting a bug or submitting a patch -------------------------------------- - -The development of Matplotlib is organized through `github -`_. If you would like -to report a bug or submit a patch please use that interface. - -To report a bug `create an issue -`_ on github -(this requires having a github account). Please include a `Short, -Self Contained, Correct (Compilable), Example `_ -demonstrating what the bug is. Including a clear, easy to test -example makes it easy for the developers to evaluate the bug. Expect -that the bug reports will be a conversation. If you do not want to -register with github, please email bug reports to the `mailing list -`_. - -The easiest way to submit patches to Matplotlib is through pull -requests on github. Please see the :ref:`developers-guide-index` for -the details. - .. _how-to-contribute-docs: Contribute to Matplotlib documentation @@ -610,7 +574,7 @@ your documents. Once your documentation contributions are working (and hopefully tested by actually *building* the docs) you can submit them as a patch -against git. See :ref:`install-git` and :ref:`how-to-submit-patch`. +against git. See :ref:`install-git` and :ref:`pr-guidelines`. Looking for something to do? Search for `TODO <../search.html?q=todo>`_ or look at the open issues on github. diff --git a/doc/faq/installing_faq.rst b/doc/faq/installing_faq.rst index 529e1be7aca2..7ced5c063218 100644 --- a/doc/faq/installing_faq.rst +++ b/doc/faq/installing_faq.rst @@ -105,7 +105,7 @@ the form of wheels. pip is installed by default with python.org and Homebrew Python, but needs to be manually installed on Macports with :: - sudo port install py36-pip + sudo port install py38-pip Once pip is installed, you can install Matplotlib and all its dependencies with from the Terminal.app command line:: diff --git a/doc/missing-references.json b/doc/missing-references.json index 382d8fe91ed1..98dc6913c6f6 100644 --- a/doc/missing-references.json +++ b/doc/missing-references.json @@ -1136,6 +1136,12 @@ "matplotlib.animation.ArtistAnimation.to_jshtml": [ "doc/api/_as_gen/matplotlib.animation.ArtistAnimation.rst:21::1" ], + "matplotlib.animation.ArtistAnimation.pause": [ + "doc/api/_as_gen/matplotlib.animation.ArtistAnimation.rst:23::1" + ], + "matplotlib.animation.ArtistAnimation.resume": [ + "doc/api/_as_gen/matplotlib.animation.ArtistAnimation.rst:23::1" + ], "matplotlib.animation.FFMpegFileWriter.args_key": [ "lib/matplotlib/animation.py:docstring of matplotlib.animation.FFMpegFileWriter.supported_formats:1::1" ], @@ -1235,6 +1241,12 @@ "matplotlib.animation.FuncAnimation.to_jshtml": [ "lib/matplotlib/animation.py:docstring of matplotlib.animation.FuncAnimation.new_frame_seq:1::1" ], + "matplotlib.animation.FuncAnimation.pause": [ + "doc/api/_as_gen/matplotlib.animation.ArtistAnimation.rst:23::1" + ], + "matplotlib.animation.FuncAnimation.resume": [ + "doc/api/_as_gen/matplotlib.animation.ArtistAnimation.rst:23::1" + ], "matplotlib.animation.HTMLWriter.bin_path": [ "doc/api/_as_gen/matplotlib.animation.HTMLWriter.rst:28::1" ], @@ -1361,6 +1373,12 @@ "matplotlib.animation.TimedAnimation.to_jshtml": [ "doc/api/_as_gen/matplotlib.animation.TimedAnimation.rst:21::1" ], + "matplotlib.animation.TimedAnimation.pause": [ + "doc/api/_as_gen/matplotlib.animation.ArtistAnimation.rst:23::1" + ], + "matplotlib.animation.TimedAnimation.resume": [ + "doc/api/_as_gen/matplotlib.animation.ArtistAnimation.rst:23::1" + ], "matplotlib.cbook.ls_mapper": [ "doc/api/prev_api_changes/api_changes_1.5.0.rst:11", "doc/api/prev_api_changes/api_changes_1.5.0.rst:8" @@ -1374,12 +1392,6 @@ "matplotlib.colorbar.ColorbarBase.set_norm": [ "doc/api/prev_api_changes/api_changes_3.1.0.rst:290" ], - "matplotlib.contour.TriContourSet": [ - "lib/matplotlib/pyplot.py:docstring of matplotlib.pyplot.tricontour:57", - "lib/matplotlib/pyplot.py:docstring of matplotlib.pyplot.tricontourf:57", - "lib/matplotlib/tri/tricontour.py:docstring of matplotlib.axes.Axes.tricontour:57", - "lib/matplotlib/tri/tricontour.py:docstring of matplotlib.axes.Axes.tricontourf:57" - ], "matplotlib.dates.rrulewrapper": [ "lib/matplotlib/dates.py:docstring of matplotlib.dates:121" ], diff --git a/doc/thirdpartypackages/index.rst b/doc/thirdpartypackages/index.rst index 7fd6257df986..21d7738b21bb 100644 --- a/doc/thirdpartypackages/index.rst +++ b/doc/thirdpartypackages/index.rst @@ -26,11 +26,11 @@ with continental and political boundaries. Cartopy ======= -`Cartopy `_ builds on top +`Cartopy `_ builds on top of Matplotlib to provide object oriented map projection definitions and close integration with Shapely for powerful yet easy-to-use vector data processing tools. An example plot from the `Cartopy gallery -`_: +`_: .. image:: /_static/cartopy_hurricane_katrina_01_00.png :height: 400px @@ -282,6 +282,14 @@ border, and logo. .. image:: /_static/mpl_template_example.png :height: 330px +figpager +======== +`figpager `_ provides +customizable figure elements such as text, lines and images +and subplot layout control for single or multi page output. + + .. image:: /_static/figpager.png + blume ===== diff --git a/doc/users/credits.rst b/doc/users/credits.rst index 093907fb132d..0c0feed44218 100644 --- a/doc/users/credits.rst +++ b/doc/users/credits.rst @@ -8,9 +8,10 @@ Credits Matplotlib was written by John D. Hunter, with contributions from an -ever-increasing number of users and developers. The current lead -developer is Thomas A. Caswell; they are assisted by many `active -`_ developers. +ever-increasing number of users and developers. The current lead developer is +Thomas A. Caswell, who is assisted by many `active developers +`_. +Please also see our instructions on :doc:`/citing`. The following is a list of contributors extracted from the git revision control history of the project: @@ -20,13 +21,17 @@ git revision control history of the project: Aaron Boushley, Aashil Patel, AbdealiJK, +Abhinav Sagar, Abhinuv Nitin Pitale, Acanthostega, Adam, Adam Ginsburg, +Adam Gomaa, Adam Heck, Adam J. Stewart, Adam Ortiz, +Adam Paszke, +Adam Ruszkowski, Adam Williamson, Adrian Price-Whelan, Adrien Chardon, @@ -41,9 +46,11 @@ Aleksey Bilogur, Alex C. Szatmary, Alex Loew, Alex Rothberg, +Alex Rudy, AlexCav, Alexander Buchkovsky, Alexander Harnisch, +Alexander Rudy, Alexander Taylor, Alexei Colin, Alexis Bienvenüe, @@ -56,6 +63,7 @@ Alon Hershenhorn, Alvaro Sanchez, Amit Aronovitch, Amy, +Amy Roberts, AmyTeegarden, AndersonDaniel, Andras Deak, @@ -77,6 +85,7 @@ Anton Akhmerov, Antony Lee, Anubhav Shrimal, Ao Liu (frankliuao), +Ardie Orden, Arie, Ariel Hernán Curiale, Arnaud Gardelein, @@ -84,6 +93,7 @@ Arpad Horvath, Arthur Paulino, Arvind, Aseem Bansal, +Ashley Whetter, Atharva Khare, Avinash Sharma, Ayappan P, @@ -106,6 +116,7 @@ Bernhard M. Wiedemann, Bharat123rox, Bianca Gibson, Binglin Chang, +Bingyao Liu, Björn Dahlgren, Blaise Thompson, Boaz Mohar, @@ -119,6 +130,7 @@ Brian Mattern, Brian McLaughlin, Brigitta Sipocz, Bruno Beltran, +Bruno Pagani, Bruno Zohreh, CJ Carey, Cameron Bates, @@ -134,22 +146,29 @@ Charles Moad, Charles Ruan, Chen Karako, Cho Yin Yong, +Chris, +Chris Barnes, Chris Beaumont, Chris G, Chris Holdgraf, Chris Zimmerman, +Christer Jensen, +Christian Brodbeck, Christian Brueffer, Christian Stade-Schuldt, Christoph Dann, Christoph Deil, Christoph Gohlke, Christoph Hoffmann, +Christoph Pohl, Christoph Reiter, Christopher Bradshaw, Cimarron Mittelsteadt, +Clemens Brunner, Cody Scot, Colin, Colin Carroll, +Cong Ma, Conner R. Phillips, Corey Farwell, Craig Citro, @@ -173,6 +192,7 @@ Darren Dale, DaveL17, David A, David Anderson, +David Chudzicki, David Haberthür, David Huard, David Kaplan, @@ -181,6 +201,7 @@ David Kua, David Stansby, David Trémouilles, Dean Malmgren, +Deng Tian, Derek Kim, Derek Tropf, Devashish Deshpande, @@ -191,8 +212,9 @@ Divyam Madaan, Dmitry Lupyan, Dmitry Mottl, Dmitry Shachnev, +Dominik Schmidt, DonaldSeo, -Dora Fraeman, +Dora Fraeman Caswell, DoriekeMG, Dorota Jarecka, Doug Blank, @@ -201,6 +223,7 @@ Duncan Macleod, Dylan Evans, E. G. Patrick Bos, Edin Salkovic, +Edoardo Pizzigoni, Egor Panfilov, Elan Ernest, Elena Glassman, @@ -216,6 +239,7 @@ Eric Firing, Eric Larson, Eric Ma, Eric O. LEBIGOT (EOL), +Eric Relson, Eric Wieser, Erik Bray, Erik M. Bray, @@ -244,10 +268,12 @@ Francesco Montesano, Francis Colas, Franco Vaccari, Francoise Provencher, +Frank Sauerburger, Frank Yu, François Magimel, Gabe, Gabriel Munteanu, +Gal Avineri, Galen Lynch, Gauravjeet, Gaute Hope, @@ -255,10 +281,13 @@ Gazing, Gellule Xg, Geoffrey Spear, Geoffroy Billotey, +Georg Raiser, Gerald Storer, +Gina, Giovanni, Graeme Smecher, Graham Poulter, +Greg Lucas, Gregory Ashton, Gregory R. Lee, Grillard, @@ -270,6 +299,7 @@ Gustavo Goretkin, HHest, Hajoon Choi, Hakan Kucukdereli, +Hanno Rein, Hans Dembinski, Hans Meine, Hans Moritz Günther, @@ -285,6 +315,8 @@ Henning Pohl, Herbert Kruitbosch, Holger Peters, Hubert Holin, +Hugo van Kemenade, +Ian Hincks, Ian Thomas, Ida Hjorth, Ignas Anikevicius (gns_ank), @@ -293,6 +325,8 @@ Ilia Kurenkov, Ilya Flyamer, ImSoErgodic, ImportanceOfBeingErnest, +Inception95, +Ingo Fründ, Ioannis Filippidis, Isa Hassen, Isaac Schwabacher, @@ -303,8 +337,10 @@ J. Goutin, Jaap Versteegh, Jack Kelly, Jacob McDonald, +Jacobson Okoro, Jae-Joon Lee, Jaime Fernandez, +Jake Lee, Jake Vanderplas, James A. Bednar, James Adams, @@ -325,7 +361,9 @@ Jason Liw Yan Chong, Jason Miller, Jason Neal, Jason Zheng, +Javad, JayP16, +Jean-Benoist Leger, Jeff Lutgen, Jeff Whitaker, Jeffrey Bingham, @@ -335,13 +373,15 @@ Jens Hedegaard Nielsen, Jeremy Fix, Jeremy O'Donoghue, Jeremy Thurgood, +Jeroonk, Jessica B. Hamrick, +Jiahao Chen, Jim Radford, Jochen Voss, Jody Klymak, Joe Kington, Joel B. Mohler, -Joel T. Frederico, +Joel Frederico, Joel Wanner, Johannes H. Jensen, Johannes Wienke, @@ -350,16 +390,23 @@ John Hunter, John Vandenberg, Johnny Gill, JojoBoulix, +Jon Haitz Legarreta Gorroño, +Jonas Camillus Jeppesen, Jonathan Waltman, +Jorge Moraleda, Jorrit Wronski, +Joscha Reimer, Josef Heinen, Joseph Albert, Joseph Fox-Rabinovitz, Joseph Jon Booker, Joseph Martinot-Lagarde, +Joshua Taillon, José Ricardo, Jouni K. Seppänen, +Joy Bhalla, Juan Nunez-Iglesias, +Juanjo Bazán, Julia Sprenger, Julian Mehne, Julian Taylor, @@ -386,6 +433,7 @@ Kevin Chan, Kevin Davies, Kevin Ji, Kevin Keating, +Kevin Mader, Kevin Rose, Kexuan Sun, Kieran Ramos, @@ -402,6 +450,8 @@ Kyler Brown, Lance Hepler, Laptop11_ASPP2016, Larry Bradley, +Laurent Thomas, +Lawrence D'Anna, Leeonadoh, Lennart Fricke, Leo Singer, @@ -418,22 +468,32 @@ Loïc Estève, Loïc Séguin-C, Luca Verginer, Luis Pedro Coelho, +Luke Davis, Maarten Baert, +Maciej Dems, Magnus Nord, Maik Riechert, Majid alDosari, Maksym P, +Manan, +Manan Kevadiya, Manish Devgan, Manuel GOACOLOU, Manuel Jung, Manuel Metz, +Manuel Nuno Melo, +Maoz Gelbart, +Marat K, Marc Abramowitz, Marcel Martin, +Marco Gorelli, +MarcoGorelli, Marcos Duarte, Marek Rudnicki, Marianne Corvellec, Marin Gilles, Mark Harfouche, +Mark Wolf, Marko Baštovanović, Markus Roth, Markus Rothe, @@ -460,8 +520,12 @@ Matthias Bussonnier, Matthias Geier, Matthias Lüthi, Matthieu Caneill, +MatthieuDartiailh, Matti Picus, Matěj Týč, +Max Chen, +Max Humber, +Max Shinn, Maximilian Albert, Maximilian Maahn, Maximilian Nöthe, @@ -476,6 +540,8 @@ Michael Sarahan, Michael Scott Cuthbert, Michael Seifert, Michael Welter, +Michaël Defferrard, +Michele Mastropietro, Michiel de Hoon, Michka Popoff, Mike Henninger, @@ -483,6 +549,7 @@ Mike Jarvis, Mike Kaufman, Mikhail Korobov, MinRK, +Mingkai Dong, Minty Zhang, MirandaXM, Miriam Sierig, @@ -491,6 +558,8 @@ Molly Rossow, Moritz Boehle, Mudit Surana, Muhammad Mehdi, +MuhammadFarooq1234, +Mykola Dvornik, Naoya Kanai, Nathan Goldbaum, Nathan Musoke, @@ -504,6 +573,7 @@ Nicholas Devenish, Nick Forrington, Nick Garvey, Nick Papior, +Nick Pope, Nick Semenkovich, Nico Schlömer, Nicolas Courtemanche, @@ -518,12 +588,16 @@ Nils Werner, Ninad Bhat, Norbert Nemec, Norman Fomferra, +O. Castany, OceanWolf, Oleg Selivanov, Olga Botvinnik, Oliver Natt, Oliver Willekens, Olivier, +Om Sitapara, +Omar Chehab, +Oriol Abril, Orso Meneghini, Osarumwense, Pankaj Pandey, @@ -532,17 +606,23 @@ Parfenov Sergey, Pascal Bugnion, Pastafarianist, Patrick Chen, +Patrick Feiring, Patrick Marsh, +Patrick Shriwise, +PatrickFeiring, Paul, Paul Barret, Paul Ganssle, +Paul Gierz, Paul Hobson, +Paul Hoffman, Paul Ivanov, Paul J. Koprowski, Paul Kirow, Paul Romano, Paul Seyfert, Pauli Virtanen, +Pavel Fedin, Pavol Juhas, Per Parker, Perry Greenfield, @@ -552,30 +632,39 @@ Pete Peterson, Peter Iannucci, Peter Mackenzie-Helnwein, Peter Mortensen, +Peter Schutt, Peter St. John, Peter Würtz, Petr Danecek, Phil Elson, Phil Ruffwind, +Philippe Pinard, Pierre Haessig, Pierre Thibault, Pierre de Buyl, Pim Schellart, Piti Ongmongkolkul, +Po, Pranav Garg, Przemysław Dąbek, Puneeth Chaganti, QiCuiHub, Qingpeng "Q.P." Zhang, RAKOTOARISON Herilalaina, +Ram Rachum, Ramiro Gómez, Randy Olson, +Raphael, Rasmus Diederichsen, Ratin_Kumar, +Rebecca W Perry, Reinier Heeres, Remi Rampin, +Ricardo Mendes, +Riccardo Di Maio, Richard Gowers, Richard Hattersley, +Richard Ji-Cathriner, Richard Trieu, Ricky, Rishikesh, @@ -588,6 +677,7 @@ Rohan Walker, Roland Wirth, Roman Yurchak, Ronald Hartley-Davies, +RoryIAngus, Roy Smith, Rui Lopes, Russell Owen, @@ -601,12 +691,15 @@ Ryan Morshead, Ryan Nelson, RyanPan, SBCV, +Sairam Pillai, Saket Choudhary, Salganos, Salil Vanvari, Salinder Sidhu, Sam Vaughan, +SamSchott, Sameer D'Costa, +Samesh Lakhotia, Samson, Samuel St-Jean, Sander, @@ -625,16 +718,22 @@ Sergey B Kirpichev, Sergey Kholodilov, Sergey Koposov, Seunghoon Park, +Siddhesh Poyarekar, +Sidharth Bansal, Silviu Tantos, Simon Cross, Simon Gibbons, +Simon Legner, Skelpdar, Skipper Seabold, Slav Basharov, +Snowhite, +SojiroFukuda, Sourav Singh, Spencer McIntyre, Stanley, Simon, Stefan Lehmann, +Stefan Mitic, Stefan Pfenninger, Stefan van der Walt, Stefano Rivera, @@ -644,10 +743,12 @@ Stephen Horst, Stephen-Chilcote, Sterling Smith, Steve Chaplin, +Steve Dower, +Steven G. Johnson, +Steven Munn, Steven Silvester, Steven Tilley, Stuart Mumford, -TD22057, Tadeo Corradi, Taehoon Lee, Takafumi Arakaki, @@ -655,7 +756,9 @@ Takeshi Kanmae, Tamas Gal, Tanuj, Taras Kuzyo, +Ted Drain, Ted Petrou, +Terence Honles, Terrence J. Katzenbaer, Terrence Katzenbaer, The Gitter Badger, @@ -671,6 +774,7 @@ Thomas Spura, Thomas VINCENT, Thorsten Liebig, Tian Xia, +Till Hoffmann, Till Stensitzki, Tim Hoffmann, Timo Vanwynsberghe, @@ -683,6 +787,7 @@ Todd Miller, Tom, Tom Augspurger, Tom Dupré la Tour, +Tom Flannaghan, Tomas Kazmar, Tony S Yu, Tor Colvin, @@ -692,6 +797,7 @@ Trish Gillett-Kawamoto, Truong Pham, Tuan Dung Tran, Tyler Makaro, +Tyrone Xiong, Ulrich Dobramysl, Umair Idris, V. Armando Solé, @@ -700,9 +806,12 @@ Vadim Markovtsev, Valentin Haenel, Valentin Schmidt, Vedant Nanda, +Venkada, Vidur Satija, Viktor Kerkez, +Vincent L.M. Mazoyer, Viraj Mohile, +Vitaly Buka, Vlad Seghete, Víctor Terrón, Víctor Zabalza, @@ -725,22 +834,24 @@ Yann Tambouret, Yao-Yuan Mao, Yaron de Leeuw, Yu Feng, +Yue Zhihan, Yunfei Yang, Yuri D'Elia, Yuval Langer, Yuxin Wu, Yuya, -ZWL, Zac Hatfield-Dodds, Zach Pincus, Zair Mubashar, Zbigniew Jędrzejewski-Szmek, Zhili (Jerry) Pan, +Zulko, ahed87, akrherz, alcinos, alex, alvarosg, +andrzejnovak, aneda, anykraus, aparamon, @@ -756,6 +867,7 @@ bduick, bev-a-tron, blackw1ng, blah blah, +brut, btang02, buefox, burrbull, @@ -765,8 +877,10 @@ captainwhippet, cclauss, ch3rn0v, chadawagner, +chaoyi1, chebee7i, chelseatroy, +chuanzhu xu, cknd, cldssty, clintval, @@ -778,18 +892,22 @@ davidovitch, daydreamt, deeenes, deepyaman, +djdt, dlmccaffrey, domspad, donald, +donchanee, drevicko, e-q, elpres, endolith, +esvhd, et2010, fardal, ffteja, fgb, fibersnet, +fourpoints, fredrik-1, frenchwr, fuzzythecat, @@ -805,17 +923,22 @@ gregorybchris, gwin-zegal, hannah, helmiriawan, +henryhu123, hugadams, ilivni, insertroar, itziakos, jacob-on-github, +jb-leger, jbbrokaw, jbhopkins, jdollichon, jerrylui803, +jess, +jfbu, jhelie, jli, +joaonsg, joelostblom, jonchar, juan.gonzalez, @@ -826,10 +949,14 @@ khyox, kikocorreoso, klaus, klonuo, +kolibril13, kramer65, +krishna katyal, +ksafran, kshramt, lboogaard, legitz7, +lepuchi, lichri12, limtaesu, lspvic, @@ -843,6 +970,8 @@ mbyt, mcelrath, mcquin, mdipierro, +mikhailov, +miquelastein, mitch, mlub, mobando, @@ -861,11 +990,13 @@ nmartensen, nwin, ob, pdubcali, +pibion, pkienzle, productivememberofsociety666, profholzer, pupssman, rahiel, +ranjanm, rebot, rhoef, rsnape, @@ -905,6 +1036,7 @@ ugurthemaster, ultra-andy, vab9, vbr, +vishalBindal, vraelvrangr, watkinrt, woclass, diff --git a/doc/users/generate_credits.py b/doc/users/generate_credits.py index edda54eddef2..265d921a20aa 100755 --- a/doc/users/generate_credits.py +++ b/doc/users/generate_credits.py @@ -17,12 +17,11 @@ ******* -Matplotlib was written by John D. Hunter, with contributions from -an ever-increasing number of users and developers. -The current co-lead developers are Michael Droettboom -and Thomas A. Caswell; they are assisted by many -`active -`_ developers. +Matplotlib was written by John D. Hunter, with contributions from an +ever-increasing number of users and developers. The current lead developer is +Thomas A. Caswell, who is assisted by many `active developers +`_. +Please also see our instructions on :doc:`/citing`. The following is a list of contributors extracted from the git revision control history of the project: diff --git a/doc/users/github_stats.rst b/doc/users/github_stats.rst index 5f127bc364bd..58abe19a6c4d 100644 --- a/doc/users/github_stats.rst +++ b/doc/users/github_stats.rst @@ -3,99 +3,1330 @@ GitHub Stats ============ -GitHub stats for 2020/03/03 - 2020/03/17 (tag: v3.2.0) +GitHub stats for 2020/03/03 - 2020/06/17 (tag: v3.2.0) These lists are automatically generated, and may be incomplete or contain duplicates. -We closed 11 issues and merged 52 pull requests. -The full list can be seen `on GitHub `__ -and `on GitHub `__ +We closed 165 issues and merged 992 pull requests. +The full list can be seen `on GitHub `__ -The following 12 authors contributed 154 commits. +The following 150 authors contributed 3603 commits. +* Adam +* Adam Paszke +* Adam Ruszkowski +* Alexander Rudy * Amy Roberts +* andrzejnovak * Antony Lee +* Ardie Orden +* Asaf Maman +* Avni Sharma +* Ben Root +* Bruno Beltran +* Bruno Pagani +* chaoyi1 +* Cho Yin Yong +* Chris +* Christoph Pohl +* Cimarron Mittelsteadt +* Clemens Brunner +* Dan Hickstein +* Dan Stromberg +* David Chudzicki +* David Stansby +* Dennis Tismenko +* Dominik Schmidt +* donchanee +* Dora Fraeman Caswell +* Edoardo Pizzigoni +* Elan Ernest * Elliott Sales de Andrade +* Emlyn Price +* Eric Firing +* Eric Larson +* Eric Relson +* Eric Wieser +* eyllanesc +* Fabien Maussion +* Frank Sauerburger +* fredrik-1 +* Gal Avineri +* Generated images +* Georg Raiser +* Gina +* Greg Lucas * hannah +* Hanno Rein +* Harshal Prakash Patankar +* henryhu123 * Hugo van Kemenade +* Ian Hincks +* ImportanceOfBeingErnest +* Inception95 +* Ingo Fründ +* Jake Lee +* Javad +* jbhopkins +* Jeroonk +* jess +* Jess Tiu +* jfbu +* Jiahao Chen * Jody Klymak +* Jon Haitz Legarreta Gorroño +* Jose Manuel Martí +* Joshua Taillon +* Juanjo Bazán +* Julian Mehne +* Kacper Kowalik (Xarthisius) +* Kevin Mader +* kolibril13 +* kopytjuk +* ksafran * Kyle Sunden +* Larry Bradley +* Laurent Thomas +* Lawrence D'Anna +* Leo Singer +* lepuchi +* Luke Davis +* Manan +* Manan Kevadiya +* manan2501 +* Manuel Nuno Melo +* Maoz Gelbart +* Marat K +* Marco Gorelli * MarcoGorelli +* Matt Newville +* Matthias Bussonnier +* Max Chen +* Max Humber * Maximilian Nöthe +* Michaël Defferrard +* Michele Mastropietro +* mikhailov +* MuhammadFarooq1234 +* Mykola Dvornik +* Nelle Varoquaux +* Nelson Darkwah Oppong +* Nick Pope +* Nico Schlömer +* Nikita Kniazev +* O. Castany +* Olivier +* Omar Chehab +* Paul Gierz +* Paul Hobson +* Paul Ivanov +* Pavel Fedin +* Peter Würtz +* Philippe Pinard +* pibion +* Po +* Pradeep Reddy Raamana +* Ram Rachum +* ranjanm +* Raphael +* Ricardo Mendes +* Riccardo Di Maio +* Ryan May +* Sadie Louise Bartholomew +* Sairam Pillai +* Samesh Lakhotia +* SamSchott * Sandro Tosi +* Siddhesh Poyarekar +* Sidharth Bansal +* Snowhite +* SojiroFukuda +* Spencer McCoubrey +* Stefan Mitic +* Stephane Raynaud +* Steven G. Johnson +* Steven Munn +* Ted Drain +* Terence Honles * Thomas A Caswell +* Thomas Robitaille +* Till Stensitzki * Tim Hoffmann +* Todd Jennings +* Tyrone Xiong +* Umar Javed +* Valentin Valls +* Venkada +* vishalBindal +* Vitaly Buka +* Ye Chang +* Yue Zhihan +* Zulko GitHub issues and pull requests: -Pull Requests (52): - -* :ghpull:`15199`: MNT/TST: generalize check_figures_equal to work with pytest.marks -* :ghpull:`15685`: Avoid a RuntimeError at animation shutdown with PySide2. -* :ghpull:`15969`: Restart pgf's latex instance after bad latex inputs. -* :ghpull:`16640`: ci: Fix Azure on v3.2.x -* :ghpull:`16648`: Document filling of Poly3DCollection -* :ghpull:`16649`: Fix typo in docs -* :ghpull:`16650`: Backport PR #16649 on branch v3.2.x (Fix typo in docs) -* :ghpull:`16651`: Docs: Change Python 2 note to past tense -* :ghpull:`16654`: Backport PR #16651 on branch v3.2.0-doc (Docs: Change Python 2 note to past tense) -* :ghpull:`16656`: Make test_imagegrid_cbar_mode_edge less flaky. -* :ghpull:`16661`: added Framework :: Matplotlib to setup -* :ghpull:`16665`: Backport PR #16661 on branch v3.2.x (added Framework :: Matplotlib to setup) -* :ghpull:`16671`: Fix some readme bits -* :ghpull:`16672`: Update CircleCI and add direct artifact link -* :ghpull:`16682`: Avoid floating point rounding causing bezier.get_parallels to fail -* :ghpull:`16690`: Backport PR #16682 on branch v3.2.x (Avoid floating point rounding causing bezier.get_parallels to fail) -* :ghpull:`16693`: TST: use pytest name in naming files for check_figures_equal -* :ghpull:`16695`: Restart pgf's latex instance after bad latex inputs. -* :ghpull:`16705`: Backport PR #16656 on branch v3.2.x (Make test_imagegrid_cbar_mode_edge less flaky.) -* :ghpull:`16708`: Backport PR #16671: Fix some readme bits -* :ghpull:`16709`: Fix saving PNGs to file objects in some places -* :ghpull:`16722`: Deprecate rcParams["datapath"] in favor of mpl.get_data_path(). -* :ghpull:`16725`: TST/CI: also try to run test_user_fonts_win32 on azure -* :ghpull:`16734`: Disable draw_foo methods on renderer used to estimate tight extents. -* :ghpull:`16735`: Make test_stem less flaky. -* :ghpull:`16736`: xpdf: Set AutoRotatePages to None, not false. -* :ghpull:`16742`: nbagg: Don't send events if manager is disconnected. -* :ghpull:`16745`: Allow numbers to set uvc for all arrows in quiver.set_UVC, fixes #16743 -* :ghpull:`16751`: Backport PR #16742 on branch v3.2.x (nbagg: Don't send events if manager is disconnected.) -* :ghpull:`16752`: ci: Disallow pytest 5.4.0, which is crashing. -* :ghpull:`16753`: Backport #16752 to v3.2.x -* :ghpull:`16760`: Backport PR #16735 on branch v3.2.x (Make test_stem less flaky.) -* :ghpull:`16761`: Backport PR #16745 on branch v3.2.x (Allow numbers to set uvc for all arrows in quiver.set_UVC, fixes #16743) -* :ghpull:`16763`: Backport PR #16648 on branch v3.2.x (Document filling of Poly3DCollection) -* :ghpull:`16764`: Backport PR #16672 on branch v3.2.0-doc -* :ghpull:`16765`: Backport PR #16736 on branch v3.2.x (xpdf: Set AutoRotatePages to None, not false.) -* :ghpull:`16766`: Backport PR #16734 on branch v3.2.x (Disable draw_foo methods on renderer used to estimate tight extents.) -* :ghpull:`16767`: Backport PR #15685 on branch v3.2.x (Avoid a RuntimeError at animation shutdown with PySide2.) -* :ghpull:`16768`: Backport PR #16725 on branch v3.2.x (TST/CI: also try to run test_user_fonts_win32 on azure) -* :ghpull:`16770`: Fix tuple markers -* :ghpull:`16779`: Documentation: make instructions for documentation contributions easier to find, add to requirements for building docs -* :ghpull:`16784`: Update CircleCI URL for downloading humor-sans.ttf. -* :ghpull:`16790`: Backport PR #16784 on branch v3.2.x (Update CircleCI URL for downloading humor-sans.ttf.) -* :ghpull:`16791`: Backport PR #16770 on branch v3.2.x (Fix tuple markers) -* :ghpull:`16794`: DOC: Don't mention drawstyle in ``set_linestyle`` docs. -* :ghpull:`16795`: Backport PR #15199 on branch v3.2.x (MNT/TST: generalize check_figures_equal to work with pytest.marks) -* :ghpull:`16797`: Backport #15589 and #16693, fixes for check_figures_equal -* :ghpull:`16799`: Backport PR #16794 on branch v3.2.0-doc (DOC: Don't mention drawstyle in ``set_linestyle`` docs.) -* :ghpull:`16800`: Fix check_figures_equal for tests that use its fixtures. -* :ghpull:`16803`: Fix some doc issues -* :ghpull:`16806`: Backport PR #16803 on branch v3.2.0-doc (Fix some doc issues) -* :ghpull:`16809`: Backport PR #16779 on branch v3.2.0-doc (Documentation: make instructions for documentation contributions easier to find, add to requirements for building docs) - -Issues (11): - -* :ghissue:`12820`: [Annotations] ValueError: lines do not intersect when computing tight bounding box containing arrow with filled paths -* :ghissue:`16538`: xpdf distiller seems broken -* :ghissue:`16624`: Azure pipelines are broken on v3.2.x -* :ghissue:`16633`: Wrong drawing Poly3DCollection -* :ghissue:`16645`: Minor typo in API document of patches.ConnectionPatch -* :ghissue:`16670`: BLD: ascii codec decode on 3.2.0 in non-UTF8 locales -* :ghissue:`16704`: 3.2.0: ``setup.py clean`` fails with ``NameError: name 'long_description' is not defined`` -* :ghissue:`16721`: nbAgg backend does not allow saving figures as png -* :ghissue:`16731`: PGF backend + savefig.bbox results in I/O error in 3.2 -* :ghissue:`16743`: Breaking change in 3.2: quiver.set_UVC does not support single numbers any more -* :ghissue:`16801`: Doc: figure for colormaps off +Pull Requests (992): + +* :ghpull:`17623`: Add a flag for disabling LTO. +* :ghpull:`17569`: Delay \usepackage{textcomp} until after the custom tex preamble. +* :ghpull:`17416`: Reorder NavigationToolbar2 methods. +* :ghpull:`17604`: DOC: Clarify offset notation and scientific notation +* :ghpull:`17617`: Rewrite pdf test to use check_figures_equal. +* :ghpull:`17654`: Small fixes to recent What's New +* :ghpull:`17649`: MNT: make _setattr_cm more forgiving +* :ghpull:`17644`: Doc 33 whats new consolidation +* :ghpull:`17647`: Fix example in docstring of cbook._unfold. +* :ghpull:`10187`: DOC: add a blitting tutorial +* :ghpull:`17471`: Removed idiomatic constructs from interactive figures docs +* :ghpull:`17639`: DOC: Update colormap deprecation warning to use Python's copy function. +* :ghpull:`17223`: Warn on invalid savefig keyword arguments +* :ghpull:`17625`: Give _DummyAxis instances a __name__ +* :ghpull:`17636`: Fix image vlim clipping again +* :ghpull:`17635`: Fix autoscaling with tiny sticky values. +* :ghpull:`17620`: MNT: make _setattr_cm more conservative +* :ghpull:`17621`: FIX: restore ability to pass a tuple to axes_class in axes_grid +* :ghpull:`16603`: axes collage +* :ghpull:`17622`: Fix typo in description of savefig.bbox. +* :ghpull:`17612`: fix resizeEvent in FigureCanvasQTAgg +* :ghpull:`17619`: Skip test_tmpconfigdir_warning when running as root. +* :ghpull:`17610`: MNT: allow 0 sized figures +* :ghpull:`17163`: Fix clipping of markers in PDF backend. +* :ghpull:`17556`: DOC: Update contributor listing in credits +* :ghpull:`17221`: Add metadata saving support to SVG. +* :ghpull:`17603`: Replace image comparison in test_axes_grid1 by geometry checks. +* :ghpull:`17428`: Doc start 33 merges +* :ghpull:`17607`: Convert adjust_bbox to use ExitStack. +* :ghpull:`17575`: DOCS: update collections.py docstrings to current doc conventions +* :ghpull:`15826`: Fix bar3d bug with matching color string and array x lengths +* :ghpull:`14507`: Simplify handling of Qt modifier keys. +* :ghpull:`17589`: Fix doc build with Sphinx < 3. +* :ghpull:`17590`: Clarify docs of set_powerlimits() +* :ghpull:`17597`: MNT: cleanup minor style issues +* :ghpull:`17183`: Update configuration of CircleCI builds +* :ghpull:`17592`: Improve docstrings of ScalarFormatter +* :ghpull:`16239`: Use the right function to disable the offset +* :ghpull:`17456`: Improve stackplot example +* :ghpull:`17545`: Improve docs of markers +* :ghpull:`17233`: Improve PDF metadata support in PGF +* :ghpull:`17086`: Remove jQuery & jQuery UI +* :ghpull:`17580`: Fix same_color() for 'none' color +* :ghpull:`17582`: Fix link in doc +* :ghpull:`17491`: DOC: Only link to overall Zenodo DOI. +* :ghpull:`17515`: FIX: add set_box_aspect, improve tight bounding box for Axes3D + fix bbox_inches support with fixed box_aspect +* :ghpull:`17581`: DOC: Remove duplicate Returns in subplot2grid. +* :ghpull:`17550`: Update subplot2grid doc to use Figure.add_gridspec, not GridSpec. +* :ghpull:`17544`: markerfacecolor should not override fillstyle='none' in plot() +* :ghpull:`15672`: Remove mention that tkagg was derived from PIL. +* :ghpull:`17573`: Examples: fix formatting issue in 'Errorbar limit selection' +* :ghpull:`17543`: Fix linewidths and colors for scatter() with unfilled markers +* :ghpull:`17448`: Add example for drawing an error band around a curve +* :ghpull:`17572`: Examples: clarity for 'set and get' example page +* :ghpull:`17276`: Allow numpy arrays in markevery +* :ghpull:`17536`: Consolidate some tests and fix a couple typos +* :ghpull:`17558`: Simplify plot_date() +* :ghpull:`17534`: Fmaussion extended boundary norm +* :ghpull:`17540`: Fix help window on GTK. +* :ghpull:`17535`: Update docs on subplot2grid / SubplotBase +* :ghpull:`17510`: Fix exception handling in FT2Font init. +* :ghpull:`16953`: Changed 'colors' paramater in PyPlot vlines/hlines and Axes vlines/hlines to default to configured rcParams 'lines.color' option +* :ghpull:`17459`: Use light icons on dark themes for wx and gtk, too. +* :ghpull:`17539`: Use symbolic icons for buttons in GTK toolbar. +* :ghpull:`15435`: Reuse png metadata handling of imsave() in FigureCanvasAgg.print_png(). +* :ghpull:`5034`: New "extend" keyword to colors.BoundaryNorm +* :ghpull:`17532`: DOC: correct legend.title_fontsize docstring +* :ghpull:`17531`: Remove unneeded check/comment re: multiprocessing in setup.py. +* :ghpull:`17522`: Privatize ttconv module. +* :ghpull:`17517`: Make sure _parent is in sync with Qt parent in NavigationToolbar2QT +* :ghpull:`17525`: DOC/API: set __qualname__ when using class factory +* :ghpull:`17511`: Fix offset legend tightbbox +* :ghpull:`16203`: Port fontconfig's font weight detection to font_manager. +* :ghpull:`17485`: Support marking a single artist as not-usetex. +* :ghpull:`17338`: Support url on more Artists in svg +* :ghpull:`17519`: Prefer demo'ing rcParams rather than rc in examples. +* :ghpull:`13457`: Give ``AnnotationBbox`` an opinion about its extent +* :ghpull:`15037`: Simplifications to errorbar(). +* :ghpull:`17493`: Update SVGs that use interpolation='none'. +* :ghpull:`15221`: Don't fallback to agg in tight_layout.get_renderer. +* :ghpull:`17512`: DOC: remove inkscape restriction in doc +* :ghpull:`17484`: Deprecate ismath parameter to draw_tex and ismath="TeX!". +* :ghpull:`17492`: Correctly set default linewidth for unfilled markers. +* :ghpull:`16908`: Adding 2d support to quadmesh set_array +* :ghpull:`17506`: Fix dicts unpacking for ``.plot`` +* :ghpull:`17496`: Fix some incorrect image clipping +* :ghpull:`17340`: convert some sample plots to use plt.subplots() instead of other methods +* :ghpull:`17504`: Undocument parameter orientation of bar() +* :ghpull:`13884`: Add some documentation for axisartist's ExtremeFinder, plus some cleanups. +* :ghpull:`17495`: Fix Pillow import in testing. +* :ghpull:`17462`: Inline FigureCanvasGtkFoo._render_figure. +* :ghpull:`17474`: Numpydocify RectangleSelector docstring. +* :ghpull:`17003`: Optimize extensions with LTO and hidden visibility +* :ghpull:`17489`: BUG: Picking vertical line broken +* :ghpull:`17486`: Simplify handling of fontproperties=None. +* :ghpull:`17478`: Add support for blitting in qt5cairo. +* :ghpull:`15641`: Make get_sample_data autoload npy/npz files. +* :ghpull:`17481`: Fix LightSource.shade on fully unmasked array. +* :ghpull:`17289`: Prepare for ragged array warnings in NumPy 1.19 +* :ghpull:`17358`: Fix masked CubicTriInterpolator +* :ghpull:`17477`: DOC: Use Sphinx-gallery animation capture +* :ghpull:`17482`: Shorten RectangleSelector._release. +* :ghpull:`17475`: Cleanup RectangleSelector example. +* :ghpull:`17461`: Deprecate the private FigureCanvasGTK3._renderer_init. +* :ghpull:`17464`: Fold _make_nseq_validator into _listify_validator. +* :ghpull:`17469`: Use qVersion, not QT_VERSION_STR -- the latter doesn't exist in PySide2. +* :ghpull:`4779`: DOC: Start to document interactive figures +* :ghpull:`17458`: Cleanup C++ code +* :ghpull:`17466`: DOC: clarify that milestones are intentions not approvals +* :ghpull:`17062`: Fix to "exported SVG files blurred in viewers" +* :ghpull:`17443`: Fix rcParams validator for dashes. +* :ghpull:`17350`: Move integerness checks to SubplotSpec._from_subplot_args. +* :ghpull:`17444`: Support odd-length dash patterns in Agg. +* :ghpull:`17405`: Show the failing line in bad-rcparams warnings. +* :ghpull:`17452`: Make validate_date throw ValueError, not RuntimeError. +* :ghpull:`17439`: Remove comment re: validation of datetime format strings. +* :ghpull:`17438`: Discourage use of proprietary Matplotlib names for freetype hinting +* :ghpull:`16990`: update testing helpers +* :ghpull:`16340`: Make set_x/ymargin() update axes limits, just like margins(). +* :ghpull:`15029`: Get default params from matplotlibrc.template. +* :ghpull:`17363`: Fix toolbar separators in wx+toolmanager. +* :ghpull:`17348`: Avoid creating a Tick in Axis.get_tick_space. +* :ghpull:`15725`: Changed line color of boxplot for dark_background +* :ghpull:`17362`: Remove status bars in toolmanager mode as well. +* :ghpull:`16551`: DOC: be more opinionated about flags passed to pip +* :ghpull:`17328`: Fixes icon clipping issue with WxAgg NavigationToolbar2 for wxpython 4.1.0 +* :ghpull:`17425`: fix typo in stem doc +* :ghpull:`17415`: Cygwin fixes +* :ghpull:`17401`: FIX: Fix for FFmpeg + GIF +* :ghpull:`16569`: MNT: improve the error message in Path init +* :ghpull:`17404`: Don't forget to dlclose() main_program in tkagg init. +* :ghpull:`17414`: Keep validate_date private. +* :ghpull:`17413`: Revert "DOC: drop the experimental tag constrained_layout and tight_layout" +* :ghpull:`17394`: Deprecate passing keys to update_keymap as single comma-separated string +* :ghpull:`17395`: TexManager fixes. +* :ghpull:`17399`: Remove qt4 backends from backend fallback candidates. +* :ghpull:`17392`: Clarify deprecation message re: tex/pgf preambles as list-of-strings. +* :ghpull:`17400`: Cleanup wx examples. +* :ghpull:`17378`: Fix marker overlap +* :ghpull:`17351`: Fix running the test suite with inkscape>=1. +* :ghpull:`17382`: FIX: properly check figure on gridspec +* :ghpull:`17390`: Small updates to troubleshooting guide. +* :ghpull:`15104`: Simplify file handling in ft2font. +* :ghpull:`17380`: Support standard names for freetype hinting flags. +* :ghpull:`15594`: Fix marker overlap +* :ghpull:`17372`: Auto-set artist.mouseover based on if get_cursor_data is overridden. +* :ghpull:`17377`: Remove code for sphinx < 1.8 +* :ghpull:`17266`: Keep explicit ticklabels in sync with ticks from FixedLocator +* :ghpull:`17359`: Fix running test_internal_cpp_api directly. +* :ghpull:`17355`: Change subprocess for inkscape version detection +* :ghpull:`17369`: CI: Add eslint for JS linting +* :ghpull:`17226`: Replace backend_driver by new example runner. +* :ghpull:`17365`: Also use light color tool buttons in qt+toolmanager+dark theme. +* :ghpull:`17366`: Restrict Qt toolbars to top/bottom of canvas. +* :ghpull:`17361`: Remove randomness from test_colorbar_get_ticks_2. +* :ghpull:`17151`: Cleanup colors.py docstrings. +* :ghpull:`16438`: Remove np.random.seed from tests that don't need it. +* :ghpull:`17287`: Make API of get_tightbbox more consistent between Axes and Axis. +* :ghpull:`17092`: Don't create a statusbar in Qt, wx backends. +* :ghpull:`17220`: Simplify Annotation and Text bbox drawing. +* :ghpull:`17353`: Make zooming work in qt-embedding example. +* :ghpull:`17344`: FIX: allow start-stop subplot +* :ghpull:`16727`: Update xtick.alignment parameter in rcsetup to validate against correct values +* :ghpull:`17236`: Add the "contour.linewidths" configuration option +* :ghpull:`16328`: Make Artist.set() apply properties in the order in which they are given. +* :ghpull:`9696`: FIX: set_url() without effect in the plot for instances of Tick +* :ghpull:`17002`: Fix AnnotationBbox picking and a bit of cleanup +* :ghpull:`17256`: Improve ps handling of individual usetex strings. +* :ghpull:`17267`: Improve image comparison decorator +* :ghpull:`17332`: Cleanup docstring of subplots(). +* :ghpull:`16843`: Deprecate is_pyqt5. +* :ghpull:`15898`: New textcolor kwarg for legend +* :ghpull:`17333`: Make sharex, etc. args of subplots() keyword-only. +* :ghpull:`17329`: Improve docs of eventplot() +* :ghpull:`17330`: Remove pnpoly license. +* :ghpull:`13656`: For single datasets, don't wrap artist added by Axes.hist in silent_list +* :ghpull:`16247`: DOC added kwargs and tight_layout description in plt.figure +* :ghpull:`16992`: Implement FigureManager.resize for macosx backend +* :ghpull:`17324`: DOC: add offset axes to secondary_axes +* :ghpull:`17311`: Make pyplot signatures of rgrids() and thetagrids() explicit +* :ghpull:`17302`: Fix alignment of offset text on top axis. +* :ghpull:`14421`: Add GridSpec.subplots() +* :ghpull:`15111`: By default, don't change the figure face/edgecolor on savefig(). +* :ghpull:`17318`: both x and y should multiply the radius +* :ghpull:`17309`: Cleanup parameter types in docstrings +* :ghpull:`17308`: Improve docs of bar() and barh() +* :ghpull:`17312`: changed axis to axes in lifecycle tutorial +* :ghpull:`16715`: Automatically create tick formatters for str and callable inputs. +* :ghpull:`16959`: Simplify and robustify ConnectionPatch coordinates conversion. +* :ghpull:`17306`: FIX: CL more stable +* :ghpull:`17301`: Use deprecate_privatize_attribute more. +* :ghpull:`16985`: Adds normalize kwarg to pie function +* :ghpull:`5243`: Enhancement of tick label offset text positioning +* :ghpull:`17292`: Deprecate various wx Toolbar attributes. +* :ghpull:`17297`: Simplify pickling support. +* :ghpull:`17298`: Fix rubberband in tk. +* :ghpull:`17299`: Avoid "dash motion" in qt zoom box. +* :ghpull:`17200`: Implement set_history_buttons for Tk toolbar. +* :ghpull:`16798`: Make the Qt interactive zoom rectangle black & white. +* :ghpull:`17296`: Fix doc wording +* :ghpull:`17282`: Don't divide by zero in Line2D.segment_hits. +* :ghpull:`17293`: Fix incorrect deprecation. +* :ghpull:`17285`: V32 mergeup +* :ghpull:`15933`: Warn if a temporary config/cache dir must be created. +* :ghpull:`15911`: Use os.getpid() in configdir, to avoid multiprocess concurrency issues +* :ghpull:`17277`: Move slow FontManager warning to FontManager constructor. +* :ghpull:`17222`: FIX: long titles x/ylabel layout +* :ghpull:`14960`: Don't generate individual doc entries for inherited Axes/Axis/Tick methods +* :ghpull:`17175`: Further sync axes_grid colorbars with standard colorbars. +* :ghpull:`17030`: Move widget functions into matplotlib.testing.widgets. +* :ghpull:`16975`: Fix "out of bounds" undefined behavior +* :ghpull:`17111`: Deprecate NavigationToolbar2._init_toolbar. +* :ghpull:`15275`: adds turbo colormap +* :ghpull:`17174`: Inline RGBAxes._config_axes to its only call site. +* :ghpull:`17156`: Deprecate text.latex.preview rcParam. +* :ghpull:`17242`: Make deprecations versions explicit +* :ghpull:`17165`: Small optimizations to scale and translate of Affine2D +* :ghpull:`17181`: Inline some private helper methods in ColorbarBase + small refactors. +* :ghpull:`17264`: Don't trigger save when gtk save dialog is closed by escape. +* :ghpull:`17262`: fix typo in set_clip_on doc +* :ghpull:`17234`: Shorten and privatize qt's UiSubplotTool. +* :ghpull:`17137`: Deprecate Toolbar.press/release; add helper to find overridden methods. +* :ghpull:`17245`: Improve error handling in _parse_scatter_color_args +* :ghpull:`15008`: ENH: add variable epoch +* :ghpull:`17260`: Text Rotation Example: Correct roation_mode typo +* :ghpull:`17258`: Improve info logged by tex subsystem. +* :ghpull:`17211`: Deprecate support for running svg converter from path contaning newline. +* :ghpull:`17078`: Improve nbAgg & WebAgg toolbars +* :ghpull:`17191`: Inline unsampled-image path; remove renderer kwarg from _check_unsampled_image. +* :ghpull:`17213`: Replace use of Bbox.bounds by appropriate properties. +* :ghpull:`17219`: Add support for suptitle() in tight_layout(). +* :ghpull:`17235`: More axisartist cleanups +* :ghpull:`17239`: Remove deprecations that expire in 3.3 +* :ghpull:`13696`: Deprecate offset_position="data". +* :ghpull:`16991`: Begin warning on modifying global state of colormaps +* :ghpull:`17053`: Replace most jQuery with vanilla JavaScript +* :ghpull:`17228`: Make params to pyplot.tight_layout keyword-only. +* :ghpull:`17225`: Remove Patch visibility tracking by Legend & OffsetBox. +* :ghpull:`17027`: Fix saving nbAgg figure after a partial blit +* :ghpull:`16847`: Ticks are not markers +* :ghpull:`17229`: Autogenerate subplots_adjust with boilerplate.py. +* :ghpull:`17209`: Simplify some axisartist code. +* :ghpull:`17204`: Draw unfilled hist()s with the zorder of lines. +* :ghpull:`17205`: Shorten tight_layout code. +* :ghpull:`17218`: Document ``Transform.__add__`` and ``.__sub__``. +* :ghpull:`17215`: Small cleanups. +* :ghpull:`17212`: Cleanup text.py. +* :ghpull:`17196`: Move polar tests to their own module. +* :ghpull:`14747`: Deprecate AxisArtist.dpi_transform. +* :ghpull:`13144`: Deprecate NavigationToolbar2GTK3.ctx. +* :ghpull:`17202`: DOC: Remove extra word +* :ghpull:`17194`: Small cleanups/simplifications/fixes to pie(). +* :ghpull:`17102`: Switch tk pan/zoom to use togglable buttons. +* :ghpull:`16832`: Correctly compute path extents +* :ghpull:`17193`: Document docstring quote convention +* :ghpull:`17195`: Fix polar tests. +* :ghpull:`17189`: Make all parameters of ColorbarBase, except ``ax``, keyword-only. +* :ghpull:`16717`: Bugfix for issue 16501 raised ValueError polar subplot with (thetamax - thetamin) > 2pi +* :ghpull:`17180`: Doc: spines arrows example +* :ghpull:`17184`: Fix various small typos. +* :ghpull:`17143`: Move linting to GitHub Actions with reviewdog. +* :ghpull:`17160`: Correctly go through property setter when init'ing Timer interval. +* :ghpull:`17166`: Deprecate ScalarMappable.check_update and associated machinery. +* :ghpull:`17177`: Manually linewrap PS hexlines. Fixes #17176 +* :ghpull:`17162`: Update docs of rc_context() +* :ghpull:`17170`: Convert SubplotZero example into centered-spines-with-arrows recipe. +* :ghpull:`17164`: Fix Figure.add_axes(rect=...). +* :ghpull:`17154`: DOC: Fix some warning and unreproducibility +* :ghpull:`17169`: Clarify that draw_event occurs after the canvas draw. +* :ghpull:`17089`: Cleanup some imports in tests +* :ghpull:`17040`: Improve docs on automated tests +* :ghpull:`17145`: CI: run pydocstyle with our custom options +* :ghpull:`16864`: Check parameter type for legend(labels) +* :ghpull:`17146`: FigureManager/NavigationToolbar2 cleanups. +* :ghpull:`16933`: Add tests for toolmanager. +* :ghpull:`17127`: ENH: allow title autopositioning to be turned off +* :ghpull:`17150`: Many docstring cleanups. +* :ghpull:`17148`: Fix most instances of D404 ("docstring should not start with 'this'"). +* :ghpull:`17142`: BUGFIX: conditional for add_axes arg deprecation +* :ghpull:`17032`: Fold table.CustomCell into Cell. +* :ghpull:`17117`: TextBox improvements. +* :ghpull:`17108`: Make widgets.TextBox work also when embedding. +* :ghpull:`17135`: Simplify pan/zoom toggling. +* :ghpull:`17134`: Don't override update() in NavigationToolbar2Tk. +* :ghpull:`17129`: In docs remove 'optional' if 'default' can be given +* :ghpull:`16963`: Deprecate Locator.refresh and associated helpers. +* :ghpull:`17133`: Fix Button widget motion callback. +* :ghpull:`17125`: Make multiline docstrings start with a newline. +* :ghpull:`17124`: Widgets cleanup. +* :ghpull:`17123`: Cleanup/Simplify Cell._set_text_position. +* :ghpull:`16862`: FIX: turn off title autopos if pad is set +* :ghpull:`15214`: Inline wx icon loading. +* :ghpull:`16831`: Simplify interactive zoom handling. +* :ghpull:`17094`: DOC: drop the experimental tag constrained_layout and tight_layout +* :ghpull:`17101`: Avoid "wrapped C/C++ object has been deleted" when closing wx window. +* :ghpull:`17028`: Changed return type of get_{x,y}ticklabels to plain list +* :ghpull:`16058`: Deprecate {ContourSet,Quiver}.ax in favor of .axes. +* :ghpull:`15349`: Use checkboxes as bullet points for the PR review checklists +* :ghpull:`17112`: Fix some link redirects in docs +* :ghpull:`17090`: DOCS: add examples of how one "should" use Bbox +* :ghpull:`17110`: Simplify connection of the default key_press and button_press handlers. +* :ghpull:`17070`: Cleanups to Qt backend. +* :ghpull:`17099`: Make Spines accessable by the attributes. +* :ghpull:`16776`: Make cursor text precision actually correspond to pointing precision. +* :ghpull:`17026`: Add eslint & prettier, and re-format JS +* :ghpull:`17091`: Make sure slider uses "x" sign before multiplicative factor. +* :ghpull:`17082`: Cleanup TextBox implementation. +* :ghpull:`17067`: Simplify and generalize _set_view_from_bbox. +* :ghpull:`17081`: Update animation_api.rst +* :ghpull:`17077`: Improve default formatter for Slider values. +* :ghpull:`17079`: Use True instead of 1 for boolean parameters. +* :ghpull:`17074`: Fixed a typo in Lifecycle of a Plot +* :ghpull:`16837`: Don't pretend to support old pythons in setup.py. +* :ghpull:`17072`: Cleanup multi_image example. +* :ghpull:`15287`: Allow sharex/y after axes creation. +* :ghpull:`16987`: Deprecate case-insensitive properties. +* :ghpull:`17059`: More missing refs fixes, and associated doc rewordings. +* :ghpull:`17057`: Simplify subgridspec example/tutorial. +* :ghpull:`17058`: Fix minor doc typos. +* :ghpull:`17024`: Clarify docs of Rectangle +* :ghpull:`17043`: Avoid spurious deprecation warning in TextBox. +* :ghpull:`17047`: Highlighted .cbook.warn_deprecated() in contributing.rst +* :ghpull:`17054`: Use slope in axline example +* :ghpull:`17048`: More missing refs fixes. +* :ghpull:`17021`: File name made more understandable +* :ghpull:`16903`: Shorten implementation of Axes methods that just wrap Axis methods. +* :ghpull:`17039`: Cleanups to contour docs. +* :ghpull:`17011`: ci: Publish result images as Azure artifacts. +* :ghpull:`17038`: Improve readability of documenting_mpl.rst +* :ghpull:`16996`: Clean up get_proj() docstring (used view_init docstring as reference) +* :ghpull:`17019`: Add return field to documentation of 'get_major_ticks' +* :ghpull:`16999`: Add section on artifacts to imshow docs +* :ghpull:`17029`: Fix table.Cell docstrings. +* :ghpull:`17025`: Fix RecursionError when closing nbAgg figures. +* :ghpull:`16971`: Don't change Figure DPI if value unchanged +* :ghpull:`16972`: Fix resize bugs in GTK +* :ghpull:`17008`: Change the description of Rectangle's xy parameter +* :ghpull:`16337`: Create axline() using slope +* :ghpull:`16947`: Fix missing parameter initialization in Axes.specgram() +* :ghpull:`17001`: Cleanup imshow_extent tutorial. +* :ghpull:`17000`: More stringent eventplot orientations. +* :ghpull:`16771`: Deprecate non-string values as legend labels +* :ghpull:`15910`: Simplify init of EventCollection. +* :ghpull:`16998`: Made INSTALL.rst consistent +* :ghpull:`15393`: Cleanup shape manipulations. +* :ghpull:`10924`: Clear() methods to Radio and CheckButtons and other improvements +* :ghpull:`16988`: Make plt.{r,theta}grids act as setters even when all args are kwargs. +* :ghpull:`16986`: update tox.ini to match pythons supported and allow flags for pytest +* :ghpull:`16111`: Move locking of fontlist.json *into* json_dump. +* :ghpull:`13110`: Slightly tighten the Bbox/Transform API. +* :ghpull:`16973`: TST: don't actually render 1k+ date ticks +* :ghpull:`16967`: Simplify animation writer fallback. +* :ghpull:`16812`: Bezier/Path API Cleanup: fix circular import issue +* :ghpull:`16968`: Add link to 3.2 min-supported-requirements. +* :ghpull:`16957`: Remove unused, private aliases Polygon._{get,set}_xy. +* :ghpull:`16960`: Improve error for quoted values in matplotlibrc. +* :ghpull:`16530`: Fix violinplot support list of pandas.Series +* :ghpull:`16939`: Cleanup/tighten axes_grid. +* :ghpull:`16942`: Cleanup and avoid refleaks OSX Timer__timer_start. +* :ghpull:`16944`: TST: update default junit_family +* :ghpull:`16823`: Dedupe implementation of axes grid switching in toolmanager. +* :ghpull:`16951`: Cleanup dates docstrings. +* :ghpull:`16769`: Fix some small style issues +* :ghpull:`16936`: FIX: Plot is now rendered with correct inital value +* :ghpull:`16937`: Making sure to keep over/under/bad in cmap resample/reverse. +* :ghpull:`16915`: Tighten/cleanup wx backend. +* :ghpull:`16923`: Test the macosx backend on Travis. +* :ghpull:`15369`: Update style docs +* :ghpull:`16893`: Robustify ``AffineBase.__eq__`` against comparing to other classes. +* :ghpull:`16904`: Turn fontdict & minor into kwonly parameters for set_{x,y}ticklabels. +* :ghpull:`16917`: Add test for close_event. +* :ghpull:`16920`: Remove unused _read_ppm_image from macosx.m. +* :ghpull:`16877`: Cleanup new_fixed_axis examples. +* :ghpull:`15049`: Annotate argument in axes class match upstream +* :ghpull:`16774`: Cleanup demo_axes_hbox_divider. +* :ghpull:`16873`: More fixes to pydocstyle D403 (First word capitalization) +* :ghpull:`16896`: set_tick_params(label1On=False) should also make offset text invisible. +* :ghpull:`16907`: Fix typo in implementation of quit_all_keys. +* :ghpull:`16900`: Document and test common_texification() +* :ghpull:`16902`: Remove dot from suffix in testing.compare. +* :ghpull:`16828`: Use more _setattr_cm, thus fix Text('').get_window_extent(dpi=...) +* :ghpull:`16901`: Cleanup many docstrings. +* :ghpull:`16840`: Deprecate support for Qt4. +* :ghpull:`16899`: Remove optional returns from TriAnalyzer._get_compressed_triangulation. +* :ghpull:`16618`: Use SubplotSpec row/colspans more, and deprecate get_rows_columns. +* :ghpull:`15392`: Autoscale for ax.arrow() +* :ghpull:`14626`: Add support for minor ticks in 3d axes. +* :ghpull:`16897`: Add back missing import. +* :ghpull:`14725`: Move the debug-mode TransformNode.write_graphviz out. +* :ghpull:`15437`: Improve handling of alpha when saving to jpeg. +* :ghpull:`15606`: Simplify OldAutoLocator and AutoDateLocator. +* :ghpull:`16863`: Shortcut for closing all figures +* :ghpull:`16876`: Small cleanups to dviread. +* :ghpull:`15680`: Use more kwonly arguments, less manual kwargs-popping. +* :ghpull:`15318`: Deprecate unused rcParams["animation.html_args"]. +* :ghpull:`15303`: Make it possible to use rc_context as a decorator. +* :ghpull:`16890`: Enables hatch alpha on SVG +* :ghpull:`16887`: Shorter event mocking in tests. +* :ghpull:`16881`: Validate tickdir strings +* :ghpull:`16846`: Disconnect manager when resizing figure for animation saving. +* :ghpull:`16871`: Shorter Path import in setupext. +* :ghpull:`16892`: Warn in the docs that MouseEvent.key can be wrong. +* :ghpull:`16209`: Dedupe boilerplate for "adoption" of figure into pyplot. +* :ghpull:`16098`: Deprecate parameter props of Shadow +* :ghpull:`15747`: Move Text init to end of Annotation init. +* :ghpull:`15679`: np.concatenate cleanups. +* :ghpull:`16778`: Remove more API deprecated in 3.1(part 7) +* :ghpull:`16886`: Finish removing mentions of idle_event. +* :ghpull:`16882`: Fix trivial docstring typos. +* :ghpull:`16874`: Fix pydocstyle D209 (Multi-line docstring closing separate line) +* :ghpull:`14044`: Remove font preamble caching in TexManager. +* :ghpull:`16724`: Fixed incorrect colour in ErrorBar when Nan value is presented +* :ghpull:`15254`: Propagate signature-modifying decorators to pyplot wrappers. +* :ghpull:`16868`: Update release guide +* :ghpull:`14442`: In the build, declare all (compulsory) extension modules together. +* :ghpull:`16866`: Cleanup/update deprecations. +* :ghpull:`16850`: use validate_[cap/join]style +* :ghpull:`16858`: Fix various numpydoc style issues +* :ghpull:`16848`: Cleanup CI setup +* :ghpull:`16845`: Fix checking of X11 builds with PySide2. +* :ghpull:`14199`: Deprecate Path helpers in bezier.py +* :ghpull:`16838`: Inline some more kwargs into setup.py's setup() call. +* :ghpull:`16841`: Cleanup errorbar subsampling example +* :ghpull:`16839`: spines doc cleanup +* :ghpull:`16844`: fix example hist(density=...) +* :ghpull:`16827`: Fix warnings in doc examples +* :ghpull:`16772`: Remove more API deprecated in 3.1 +* :ghpull:`16822`: fix bug where make_compound_path kept all STOPs +* :ghpull:`16819`: Destroy figures by manager instance, not by number. +* :ghpull:`16824`: Deprecate NavigationToolbar2QT.parent. +* :ghpull:`16825`: Don't use deprecated Gtk add_with_viewport. +* :ghpull:`16816`: Merge v3.2.x into master +* :ghpull:`16786`: Simple cleanups to formatters. +* :ghpull:`16807`: Update barchart_demo. +* :ghpull:`16804`: Deprecate some mathtext glue helper classes. +* :ghpull:`16808`: One more instance of check_in_list. +* :ghpull:`16802`: Fix incorrect super class of VCentered. +* :ghpull:`16789`: Update markup for collections docstrings. +* :ghpull:`16781`: Update image tutorial wrt. removal of native png handler. +* :ghpull:`16787`: Avoid vstack() when possible. +* :ghpull:`16689`: Add a fast path for NumPy arrays to Collection.set_verts +* :ghpull:`15373`: Further shorten quiver3d computation... +* :ghpull:`16780`: Don't import rcParams but rather use mpl.rcParams (part 3) +* :ghpull:`16775`: Cleanup axes_divider examples. +* :ghpull:`15949`: Simplify implementation of SubplotTool. +* :ghpull:`14869`: Deduplicate code for text-to-path conversion in svg backend. +* :ghpull:`16527`: Validate positional parameters of add_subplot() +* :ghpull:`15622`: Cleanup mpl_toolkits locators. +* :ghpull:`16744`: Reword axes_divider tutorial. +* :ghpull:`16746`: Reword colorbar-with-axes-divider example. +* :ghpull:`15211`: Various backend cleanups. +* :ghpull:`15890`: Remove API deprecated in 3.1 (part 2) +* :ghpull:`16757`: Simplify interactive zoom handling. +* :ghpull:`15515`: Combine withEffect PathEffect definitions. +* :ghpull:`15977`: pgf backend cleanups. +* :ghpull:`15981`: Reuse colorbar outline and patch when updating the colorbar. +* :ghpull:`14852`: Use Path.arc() to interpolate polar arcs. +* :ghpull:`16686`: Deprecate Substitution.from_params. +* :ghpull:`16675`: Vectorize patch extraction in Axes3D.plot_surface +* :ghpull:`15846`: Standardize signature mismatch error messages. +* :ghpull:`16740`: Fix type of ``dpi`` in docstrings. +* :ghpull:`16741`: Dedupe RGBAxes examples. +* :ghpull:`16755`: Reword docstring of panning callbacks, and pass them a MouseButton. +* :ghpull:`16749`: Document behavior of savefig("extensionless-name"). +* :ghpull:`16754`: Cleanup image.py. +* :ghpull:`14606`: Generic cleanup to hist(). +* :ghpull:`16692`: Allow MarkerStyle instances as input for lines +* :ghpull:`15479`: Cleanup axes_rgb. +* :ghpull:`16617`: Use Path(..., closed=True) more. +* :ghpull:`16710`: Make format_coord messagebox resize with the window and the content in osx backend +* :ghpull:`16681`: Simplify docstring interpolation for Box/Arrow/ConnectionStyles. +* :ghpull:`16576`: Deprecate arg-less calls to subplot_class_factory (and similar factories) +* :ghpull:`16652`: Deprecate {Locator,Axis}.{pan,zoom}. +* :ghpull:`16596`: Deprecate dviread.Encoding. +* :ghpull:`16231`: Deprecate JPEG-specific kwargs and rcParams to savefig. +* :ghpull:`16636`: Deprecate autofmt_xdate(which=None) to mean which="major". +* :ghpull:`16644`: Deprecate validate_webagg_address. +* :ghpull:`16619`: Fix overindented lines. +* :ghpull:`15233`: backend_ps cleanup. +* :ghpull:`16604`: Deprecate more rc validators. +* :ghpull:`16601`: Small unrelated cleanups. +* :ghpull:`16584`: Rename font_bunch to psfont in textpath. +* :ghpull:`16023`: Dedupe implementations of fill_between & fill_betweenx. +* :ghpull:`16485`: Simplify validate_color_for_prop_cycle. +* :ghpull:`16285`: Deprecate RendererCairo.font{weights,angles} +* :ghpull:`16410`: Fix support for empty usetex strings. +* :ghpull:`11644`: Add feature to fallback to stix font in mathtext +* :ghpull:`16537`: Delay checking for existence of postscript distillers. +* :ghpull:`16351`: Group all init of Legend.legendPatch together. +* :ghpull:`15988`: Refactor Annotation properties. +* :ghpull:`16421`: Shorten the type1-to-unicode name table. +* :ghpull:`16200`: Deprecate Artist.{set,get}_contains. +* :ghpull:`15828`: Deprecate support for dash-offset = None. +* :ghpull:`16338`: Document SymmetricalLogLocator parameters. +* :ghpull:`16504`: DOC: more pcolor fixes +* :ghpull:`15996`: Cleanup axes_size. +* :ghpull:`16108`: Deprecate DraggableBase.on_motion_blit. +* :ghpull:`16706`: Fix exception causes all over the codebase +* :ghpull:`15855`: Simplify 3d axes callback setup. +* :ghpull:`16219`: Simplify CallbackRegistry pickling. +* :ghpull:`16002`: relax two test tolerances on x86_64 +* :ghpull:`16063`: Make the signature of Axes.draw() consistent with Artist.draw(). +* :ghpull:`16177`: Further simplify setupext. +* :ghpull:`16191`: Make Figure._axobservers a CallbackRegistry. +* :ghpull:`16698`: Small edits to toolkits docs. +* :ghpull:`15430`: Simplify setupext.download_or_cache. +* :ghpull:`16694`: Lower Text's FontProperties priority when updating +* :ghpull:`16511`: Add more detailed kwargs docstrings to Axes methods. +* :ghpull:`16653`: Tutorials: make path/URL option clearer in matplotlibrc tutorial +* :ghpull:`16697`: Update docstrings for plot_directive. +* :ghpull:`16684`: Fix exception causes in 19 modules +* :ghpull:`16674`: Docstring + import cleanups to legend.py. +* :ghpull:`16683`: Turn mathtext.GlueSpec into a (private) namedtuple. +* :ghpull:`16660`: Cleanup fancybox_demo. +* :ghpull:`16691`: Clarify tiny comment re: AnnotationBbox constructor. +* :ghpull:`16676`: Cleanup animation docstrings. +* :ghpull:`16673`: DOC: correct title_fontsize docstring +* :ghpull:`16669`: DOC: update doc release guide +* :ghpull:`16563`: Parametrize imshow antialiased tests. +* :ghpull:`16658`: In docs, add multi-axes connectionpatches to Figure, not Axes. +* :ghpull:`16647`: Update annotation tutorial. +* :ghpull:`16638`: Remove unused, outdated division operators on jpl_units. +* :ghpull:`16509`: Add custom math fallback +* :ghpull:`16609`: Fix exception causes in rcsetup.py +* :ghpull:`16637`: Update docstrings in figure.py. +* :ghpull:`16534`: DOC: MaxNLocator and contour/contourf doc update (replaces #16428) +* :ghpull:`16597`: close #16593: setting ecolor turns off color cycling +* :ghpull:`16615`: Update custom boxstyles example. +* :ghpull:`16610`: Added graphviz_docs to conf.py +* :ghpull:`16608`: Stricter validation of rcParams["axes.axisbelow"]. +* :ghpull:`16614`: Cleanup quiver3d examples. +* :ghpull:`16556`: Make backend_ps test robust against timestamp changes in ghostscript. +* :ghpull:`16602`: Cleanup testing.compare. +* :ghpull:`16575`: Style fix for dynamic axes subclass generation in mpl_toolkits. +* :ghpull:`16587`: Remove warnings control from tests.py. +* :ghpull:`16599`: Cleanup dolphin example. +* :ghpull:`16586`: Deprecate recursionlimit kwarg to matplotlib.test(). +* :ghpull:`16595`: Minor docstring/references update. +* :ghpull:`16579`: Update usetex_fonteffects example. +* :ghpull:`16578`: Use rc() less often in examples/tutorials. +* :ghpull:`16572`: Remove some remnants of hist{,2d}(normed=...). +* :ghpull:`16491`: Expire the _rename_parameters API changes. +* :ghpull:`14592`: In SecondaryAxis.set_functions, reuse _set_scale's parent scale caching. +* :ghpull:`16279`: STY: Fix underindented continuation lines. +* :ghpull:`16549`: Improve documentation for examples/widgets/textbox.py +* :ghpull:`16560`: Update URL to pyparsing. +* :ghpull:`16292`: More edits to Normalize docstrings. +* :ghpull:`16536`: API/TST: minimum versions +* :ghpull:`16559`: 3D example avoid using statefull .gca() +* :ghpull:`16553`: DOC: clarify the expected shapes of eventplot input +* :ghpull:`16535`: Clarify docs of num parameter of plt.figure() +* :ghpull:`16547`: Reformat/reword mathtext docstrings. +* :ghpull:`16545`: Add a smoketest for ps.usedistiller="xpdf". +* :ghpull:`16529`: Deprecate toggling axes navigatability using the keyboard. +* :ghpull:`16521`: Remove more API deprecated in 3.1. +* :ghpull:`16481`: Update set_thetalim documentation +* :ghpull:`16524`: Cleanup docstrings +* :ghpull:`16540`: Cleanup imports +* :ghpull:`16429`: CI: update codecov +* :ghpull:`16533`: Recommend to amend pull requests +* :ghpull:`16531`: Also deprecate ignorecase ValidateInStrings. +* :ghpull:`16428`: DOC: MaxNLocator and contour/contourf doc update +* :ghpull:`16525`: Don't import rcParams but rather use mpl.rcParams (part 2) +* :ghpull:`16528`: Improve test failure messages on warnings. +* :ghpull:`16393`: Shorten PyFT2Font_get_charmap. +* :ghpull:`16483`: Deprecate most ValidateInStrings validators. +* :ghpull:`16523`: Reorder mathtext rcparams in matplotlibrc template. +* :ghpull:`16520`: Update a comment re: minimum version of numpy working around bug. +* :ghpull:`16522`: Fix deprecation warning +* :ghpull:`16515`: Fix doc for set_{x,y}label, and then some more. +* :ghpull:`16516`: Fixes to boxplot() docstring & error messages. +* :ghpull:`16508`: Multi-dim transforms are non-separable by default. +* :ghpull:`16507`: Factor out common parts of ``__str__`` for Transform subclasses. +* :ghpull:`16514`: Various delayed PR reviews +* :ghpull:`16512`: Fix a bunch of random typos. +* :ghpull:`16510`: Doc markup cleanups. +* :ghpull:`16500`: Dedupe timer attribute docs. +* :ghpull:`16503`: DOC: suppress warning on pcolor demo +* :ghpull:`16495`: Deemphasize basemap in user-facing docs. +* :ghpull:`16484`: Don't forget to set stretch when exporting font as svg reference. +* :ghpull:`16486`: Simplify validate_color, and make it slightly stricter. +* :ghpull:`16246`: Avoid using FontProperties when not needed. +* :ghpull:`16432`: Prefer geomspace() to logspace(). +* :ghpull:`16099`: Consistently name callback arguments event instead of evt +* :ghpull:`16477`: Remove some APIs deprecated in mpl3.1. +* :ghpull:`16475`: Use vlines() and plot(), not stem(), in timeline example. +* :ghpull:`16474`: Switch default of stem(use_line_collection=...) to True. +* :ghpull:`16467`: Convert named_colors example to use Rectangle +* :ghpull:`16047`: Remove more API deprecated in 3.1 +* :ghpull:`16373`: Fix usetex_baseline_test. +* :ghpull:`16433`: Simplify demo_curvelinear_grid2. +* :ghpull:`16472`: Fix mplot3d projection +* :ghpull:`16092`: Deprecate clear_temp param/attr of FileMovieWriter. +* :ghpull:`15504`: Warn when trying to start a GUI event loop out of the main thread. +* :ghpull:`15023`: Simplify formatting of matplotlibrc.template. +* :ghpull:`13535`: Validate inputs to ScalarMappable constructor +* :ghpull:`16469`: FIX: colorbar minorticks when rcParams['x/ytick.minor.visible'] = True +* :ghpull:`16401`: BLD: Auto-detect PlatformToolset +* :ghpull:`16024`: Keep parameter names in preprocess_data. +* :ghpull:`13390`: Make sure that scatter3d copies its inputs. +* :ghpull:`16107`: Deprecate DraggableBase.artist_picker. +* :ghpull:`16455`: Update some docstrings in colors.py +* :ghpull:`16456`: Enable more font_manager tests to be run locally. +* :ghpull:`16459`: Update backend dependency docs. +* :ghpull:`16444`: Dedupe spectral plotting tests. +* :ghpull:`16460`: Remove some mentions of avconv, following its deprecation. +* :ghpull:`16443`: Parametrize some spectral tests. +* :ghpull:`16204`: Expire deprecation of \mathcircled +* :ghpull:`16446`: Replace matshow baseline test by check_figures_equal. +* :ghpull:`16418`: Backend timer simplifications. +* :ghpull:`16454`: Use pytest.raises(match=...) +* :ghpull:`14916`: Make kwargs names in scale.py not include the axis direction. +* :ghpull:`16258`: ENH: add shading='nearest' and 'auto' to ``pcolormesh`` +* :ghpull:`16228`: Allow directly passing explicit font paths. +* :ghpull:`16445`: Remove a bunch of imports-within-tests. +* :ghpull:`16440`: Expire deprecation of \stackrel. +* :ghpull:`16439`: Rework pylab docstring. +* :ghpull:`16441`: Rework pylab docstring. +* :ghpull:`16442`: Expire deprecation of \stackrel. +* :ghpull:`16365`: TST: test_acorr (replaced image comparison with figure comparion) +* :ghpull:`16206`: Expire deprecation of \stackrel +* :ghpull:`16437`: Rework pylab docstring. +* :ghpull:`8896`: Fix mplot3d projection +* :ghpull:`16430`: Remove unnecessary calls to np.array in examples. +* :ghpull:`16407`: Remove outdated comment re: PYTHONHASHSEED and pytest. +* :ghpull:`16225`: Cleanup animation examples. +* :ghpull:`16336`: Include axline() in infinite lines example +* :ghpull:`16395`: Add set/get for ellipse width/height +* :ghpull:`16431`: CI: add py38 to azure matrix +* :ghpull:`16415`: Expire some APIs deprecated in mpl3.1. +* :ghpull:`16425`: MNT: rename internal variable +* :ghpull:`16427`: Style-fix some examples and update .flake8 per-file-ignores. +* :ghpull:`16423`: Slightly improve streamplot code legibility. +* :ghpull:`16414`: DOC: Fix ``axes:plot`` method docstring verb tense +* :ghpull:`16408`: Deprecate avconv animation writers. +* :ghpull:`16406`: Don't import rcParams but rather use mpl.rcParams. +* :ghpull:`16326`: Cleanup stack +* :ghpull:`16193`: Catch shadowed imports in style checks. +* :ghpull:`16374`: Log about font manager generation beforehand. +* :ghpull:`16372`: Dedupe ImageGrid doc from tutorial and docstring. +* :ghpull:`16380`: "gif" third-party package added to the extension page +* :ghpull:`16327`: Cleanup list copying +* :ghpull:`16366`: Special-case usetex minus to zero depth. +* :ghpull:`16350`: TST: Improved test (getting rid of image comparison test for test_titletwiny) +* :ghpull:`16359`: Make Text.update_from copy usetex state. +* :ghpull:`16355`: typo in ``ticker.ScalarFormatter`` doc +* :ghpull:`15440`: Use rcParams to control default "raise window" behavior (Qt,Gtk,Tk,Wx) +* :ghpull:`16302`: Cleanup Legend._auto_legend_data. +* :ghpull:`16329`: ENH: add zorder kwarg to contour clabel (and a better default value for zorder) +* :ghpull:`16341`: Remove mention of now-removed --verbose-foo flags. +* :ghpull:`16265`: Fix spy(..., marker=, origin="lower") +* :ghpull:`16333`: Document animation HTML writer. +* :ghpull:`16334`: Fix doc regarding deprecation of properties. +* :ghpull:`16335`: Fix some more missing references. +* :ghpull:`16304`: Simplify Legend.get_children. +* :ghpull:`16309`: Remove duplicated computations in Axes.get_tightbbox. +* :ghpull:`16314`: Avoid repeatedly warning about too many figures open. +* :ghpull:`16319`: Put doc for XAxis befor YAxis and likewise for XTick, YTick. +* :ghpull:`16313`: Cleanup constrainedlayout_guide. +* :ghpull:`16312`: Remove unnecessary Legend._approx_text_height. +* :ghpull:`16307`: Cleanup axes_demo. +* :ghpull:`16303`: Dedupe Legend.draw_frame which is the same as set_frame_on. +* :ghpull:`16261`: TST: move the Qt-specific handling to conftest +* :ghpull:`16297`: DOC: fix description of vmin/vmax in scatter +* :ghpull:`16288`: Remove the private, unused _csv2rec. +* :ghpull:`16281`: Update/cleanup pgf tutorial. +* :ghpull:`16283`: Cleanup backend_agg docstrings. +* :ghpull:`16282`: Replace "unicode" by "str" in docs, messages when referring to the type. +* :ghpull:`16289`: axisartist tutorial markup fixes. +* :ghpull:`16293`: Revert "Fix doc CI by pointing to dev version of scipy docs." +* :ghpull:`16287`: Improve markup for rcParams in docs. +* :ghpull:`16271`: Clean up and clarify Normalize docs +* :ghpull:`16290`: Fix doc CI by pointing to dev version of scipy docs. +* :ghpull:`16276`: Cleanup docstring of print_figure, savefig. +* :ghpull:`16277`: Prefer using MouseButton to numeric values in docs and defaults. +* :ghpull:`16270`: numpydoc-ify SymLogNorm +* :ghpull:`16274`: Tiny cleanups to set_xlabel(..., loc=...). +* :ghpull:`16273`: DOC: Changing the spelling of co-ordinates. +* :ghpull:`15974`: Enable set_{x|y|}label(loc={'left'|'right'|'center'}...) +* :ghpull:`16248`: Update matplotlib.__doc__. +* :ghpull:`16262`: Dedupe update of rcParams["backend"] in use() and in switch_backend() +* :ghpull:`9629`: Make pcolor(mesh) preserve all data +* :ghpull:`16254`: DOC: pdf.preamble --> pgf.preamble +* :ghpull:`16245`: Cleanup image docs +* :ghpull:`16117`: CI: Unify required dependencies installation +* :ghpull:`16240`: Cleanup custom_scale example. +* :ghpull:`16227`: Make Animation.repeat_delay an int, not an int-or-None. +* :ghpull:`16242`: CI: Remove PYTHONUNBUFFERED=1 on Appveyor +* :ghpull:`16183`: Remove some baseline images for plot() tests. +* :ghpull:`16229`: And more missing refs. +* :ghpull:`16215`: Concise dates test +* :ghpull:`16233`: Reword ScalarFormatter docstrings. +* :ghpull:`16218`: Cleanup animation docs. +* :ghpull:`16172`: And more missing references. +* :ghpull:`16205`: Deprecate the empty matplotlib.compat. +* :ghpull:`16214`: Fix overindented line in AnchoredOffsetbox doc. +* :ghpull:`15943`: Deprecate the TTFPATH & AFMPATH environment variables. +* :ghpull:`16039`: Deprecate unused features of normalize_kwargs. +* :ghpull:`16202`: Remove outdated statement in tight_layout guide. +* :ghpull:`16201`: UnCamelCase examples. +* :ghpull:`16194`: Numpydoc ticklabel_format. +* :ghpull:`16195`: Numpydoc ContourSet.find_nearest_contour. +* :ghpull:`16198`: Remove em dash +* :ghpull:`16199`: Do not use camel case for variables in examples +* :ghpull:`15644`: Rewrite cursor example to include speedup possibilities +* :ghpull:`16196`: Cleanup patches docstrings. +* :ghpull:`16184`: Expire a mpl2.2-deprecated API +* :ghpull:`16188`: Remove ref. to non-existent method in animation tests. +* :ghpull:`16170`: Deprecate old and little used formatters. +* :ghpull:`16187`: Fix overly long lines in examples & tutorials. +* :ghpull:`15982`: Colorbar cleanup. +* :ghpull:`16154`: Deprecate setting pickradius via set_picker +* :ghpull:`16174`: Numpydocify artist.getp(). +* :ghpull:`16165`: Remove rcParams deprecated in mpl3.0/3.1. +* :ghpull:`16141`: Update _base.py +* :ghpull:`16169`: Add missing spaces after commas. +* :ghpull:`15847`: Remove some dead branches from texmanager code. +* :ghpull:`16125`: Fix more missing references again. +* :ghpull:`16150`: Simplify transforms addition. +* :ghpull:`16152`: Inline _init_axes_pad into Grid.__init__. +* :ghpull:`16129`: Deprecate some Transform aliases in scale.py. +* :ghpull:`16162`: (Mostly) avoid the term "command" in the docs. +* :ghpull:`16159`: Simple cleanups for contour.py. +* :ghpull:`16164`: Fix trivial typo in deprecation warning message. +* :ghpull:`16160`: Cleanup hist() docstring. +* :ghpull:`16149`: DOC: reword density desc in ``ax.hist`` +* :ghpull:`16151`: Remove outdated comment re: blended transforms. +* :ghpull:`16102`: Rework example "Scatter Star Poly" to "Marker examples" +* :ghpull:`16134`: Validate Line2D pickradius when setting it, not when reading it. +* :ghpull:`15019`: Add step option where='edges' to facilitate pre-binned hist plots +* :ghpull:`16142`: Avoid using np.r\_, np.c\_. +* :ghpull:`16146`: Remove LICENSE_CONDA. +* :ghpull:`16133`: Reword docstring of Line2D.contains. +* :ghpull:`16120`: Minor fontproperty fixes. +* :ghpull:`15670`: Reuse Grid.__init__ in ImageGrid.__init__. +* :ghpull:`16025`: Deprecate update_datalim_bounds. +* :ghpull:`16001`: Remove parameters deprecated in 3.1 +* :ghpull:`16049`: Add __repr__ to SubplotSpec. +* :ghpull:`16100`: Consistently name event callbacks on_[event] +* :ghpull:`16106`: In DraggableLegend, inherit DraggableBase.artist_picker. +* :ghpull:`16109`: Name Axes variables ax instead of a +* :ghpull:`16115`: Fix more missing references. +* :ghpull:`16096`: Deprecate unused parameters +* :ghpull:`16085`: Improve docstrings in offsetbox.py +* :ghpull:`16097`: Cleanup unused variables +* :ghpull:`16101`: Fix incorrect doc regarding projections. +* :ghpull:`16095`: Deprecate MovieWriter.{exec,args}_key, making them private. +* :ghpull:`16078`: Refactor a bit animation start/save interaction. +* :ghpull:`16081`: Delay resolution of animation extra_args. +* :ghpull:`16088`: Use C++ true/false in ttconv. +* :ghpull:`16082`: Defaut to writing animation frames to a temporary directory. +* :ghpull:`16070`: Make animation blit cache robust against 3d viewpoint changes. +* :ghpull:`5056`: MNT: more control of colorbar with CountourSet +* :ghpull:`16051`: Deprecate parameters to colorbar which have no effect. +* :ghpull:`16045`: Use triple-double-quotes for docstrings +* :ghpull:`16076`: Cleanup path_editor example. +* :ghpull:`16059`: Simplify colorbar test. +* :ghpull:`16072`: Cleanup category.py docstrings. +* :ghpull:`15769`: scatter() should not rescale if norm is given +* :ghpull:`16060`: Cleanup pcolor_demo. +* :ghpull:`16057`: Trivial docstring fix for cbook.deprecated. +* :ghpull:`16043`: Simplify some comparisons +* :ghpull:`16044`: Code style cleanup +* :ghpull:`15894`: rcsetup cleanups. +* :ghpull:`16050`: Unbreak CI. +* :ghpull:`16034`: Update comments re: colors._vector_magnitude. +* :ghpull:`16035`: Make eventplot use the standard alias resolution mechanism. +* :ghpull:`15798`: Better default behavior for boxplots when rcParams['lines.marker'] is set +* :ghpull:`16004`: Improve documentation of text module +* :ghpull:`15507`: Use FixedFormatter only with FixedLocator +* :ghpull:`16008`: Remove unused imports +* :ghpull:`16036`: Rely on pytest to record warnings, rather than doing it manually. +* :ghpull:`15734`: Fix home/forward/backward buttons for 3d plots. +* :ghpull:`16038`: Cleanup contour_demo. +* :ghpull:`15998`: Join marker reference and marker fiillstyle reference +* :ghpull:`15976`: Cleanup span_where. +* :ghpull:`15990`: Remove deprecated support for setting single property via multiple aliases +* :ghpull:`15940`: Some unicode-support related cleanups. +* :ghpull:`15836`: Compactify a bit the EventCollection tests. +* :ghpull:`16013`: Relayout some conditions in axes_grid. +* :ghpull:`16010`: Inherit the Artist.draw docstring in subclasses. +* :ghpull:`16017`: Document support for no-args plt.subplot() call. +* :ghpull:`16014`: Simplify calls to AxesGrid/ImageGrid. +* :ghpull:`16012`: Normalize aspect="equal" to aspect=1 in the setter. +* :ghpull:`15997`: Shorten wx _onMouseWheel. +* :ghpull:`15993`: Style fixes for axes_divider. +* :ghpull:`15989`: Simplify Artist.update. +* :ghpull:`16015`: Some small extension cleanups +* :ghpull:`16011`: Replace axes_size.Fraction by multiplication. +* :ghpull:`15719`: Templatize spectral helpers. +* :ghpull:`15995`: Remove toolkit functions deprecated in 3.1 +* :ghpull:`16003`: prevent needless float() conversion +* :ghpull:`16000`: De-deprecate \*min/\*max parameters to set_x/y/zlim() +* :ghpull:`15684`: Avoid RuntimeError at wx exit. +* :ghpull:`15992`: Avoid using np.matrix. +* :ghpull:`15961`: Be more opinionated for setting up a dev env. +* :ghpull:`15991`: Avoid setting dtypes as strings... +* :ghpull:`15985`: Remove unnecessary :func:, :meth: from examples markup. +* :ghpull:`15983`: Fix some examples docstrings. +* :ghpull:`15979`: Remove references to scipy cookbook. +* :ghpull:`14874`: On POSIX, allow testing from non-localfreetype builds. +* :ghpull:`15966`: FIX: check subplot kwargs +* :ghpull:`15947`: Merge the two usetex demos. +* :ghpull:`15939`: Exceptions should start with a capital letter +* :ghpull:`15948`: Use rc_context more. +* :ghpull:`15962`: Add tests for IndexFormatter +* :ghpull:`15965`: Test registering cmaps +* :ghpull:`15950`: Remove deprecated TextWithDash +* :ghpull:`15942`: Update docs of type1font +* :ghpull:`15927`: Trying to set the labels without setting ticks through pyplot now raises TypeError* +* :ghpull:`15944`: Minor doc cleanups +* :ghpull:`15945`: Do not use "object" or "instance" when documenting types +* :ghpull:`15897`: Cleanup TriAnalyzer docs +* :ghpull:`15777`: Don't bother disconnecting idle_draw at gtk shutdown. +* :ghpull:`15929`: Remove unused cbook._lockstr. +* :ghpull:`15935`: Raise an ValueError when Axes.pie accepts negative values #15923 +* :ghpull:`15895`: Deprecate unused illegal_s attribute. +* :ghpull:`15900`: Rewrite test_cycles to avoid image comparison tests. +* :ghpull:`15892`: Update docs of backend_manager +* :ghpull:`15878`: Remove API deprecated in 3.1 +* :ghpull:`15928`: DOC: use markers as slanted breaks in broken axis example +* :ghpull:`14659`: Update some widget docstrings. +* :ghpull:`15919`: Remove mod_python specific code. +* :ghpull:`15883`: Improve error when passing 0d array to scatter(). +* :ghpull:`15907`: More docstrings cleanup. +* :ghpull:`15906`: Cleanup legend docstrings. +* :ghpull:`15776`: Improve doc for data kwarg. +* :ghpull:`15904`: Deemphasize ACCEPTS blocks in documenting_mpl docs. +* :ghpull:`15891`: Mark self.* expressions in docstrings as literal +* :ghpull:`15875`: Deprecate implicit creation of colormaps in register_cmap() +* :ghpull:`15885`: Cleanup text.py docstrings. +* :ghpull:`15888`: Cleanup backend_bases docs. +* :ghpull:`15887`: Fix AnnotationBbox docstring. +* :ghpull:`15858`: Avoid some uses of len-1 tuples. +* :ghpull:`15873`: Standardize parameter types in docs +* :ghpull:`15874`: Cleanup backend_bases docs +* :ghpull:`15876`: Deprecate case-insensitive capstyles and joinstyles. +* :ghpull:`15877`: Suppress exception chaining on rc validator failure. +* :ghpull:`15880`: Use True/False instead of 0/1 as booleans in backend_ps. +* :ghpull:`15827`: Fix validation of linestyle in rcparams and cycler. +* :ghpull:`15850`: Docstrings cleanup in matplotlib.axes +* :ghpull:`15853`: np.abs -> (builtins).abs +* :ghpull:`15702`: Make AnnotationBase class public +* :ghpull:`15712`: Make _ImageBase class public +* :ghpull:`15854`: Simplify Axes3D init. +* :ghpull:`15822`: More cleanup defaults in docstrings +* :ghpull:`15838`: Remove some references to Py2. +* :ghpull:`15834`: Optimize colors.to_rgba. +* :ghpull:`15830`: Allow failure on nightly builds. +* :ghpull:`15788`: Fixes pyplot xticks() and yticks() by allowing setting only the labels +* :ghpull:`15805`: Improve docs on figure size +* :ghpull:`15783`: Fix stepfilled histogram polygon bottom perimeter +* :ghpull:`15812`: Cleanup defaults in docstrings +* :ghpull:`15804`: Cleanup many docstrings. +* :ghpull:`15790`: Update docs of PolyCollection +* :ghpull:`15792`: Cleanup dviread docs. +* :ghpull:`15801`: Cleanup some references to rcParams in docs. +* :ghpull:`15787`: Cleanup ``Colormap.__call__``. +* :ghpull:`15766`: Shorten description on search page +* :ghpull:`15786`: Slightly clarify the implementation of safe_masked_invalid. +* :ghpull:`15767`: Update badges in README.rst +* :ghpull:`15778`: Fix typos and comma splices in legend guide +* :ghpull:`15775`: Some pathlibification. +* :ghpull:`15772`: Directly dedent the spectral parameter docs. +* :ghpull:`15765`: Reword some docstrings. +* :ghpull:`15686`: Simplify and unify character tracking in pdf and ps backends (with linked fonts) +* :ghpull:`9321`: Add Axes method for drawing infinite lines +* :ghpull:`15749`: Fix travis links in README +* :ghpull:`15673`: Rely on findfont autofallback-to-default in pdf/ps backends. +* :ghpull:`15740`: Small animation cleanup. +* :ghpull:`15739`: ImageMagick animators now can use extra_args +* :ghpull:`15591`: Remove FAQ on 'Search' -- already referenced in search file +* :ghpull:`15629`: Consistently use realpaths to build XObject names +* :ghpull:`15696`: Improve mathtext.fontset docs and fix :mathmpl: cache bug. +* :ghpull:`15721`: Render default values in :rc: directive as literal +* :ghpull:`15720`: Suppress triage_tests warning on Py3.8. +* :ghpull:`15709`: Make 3d plot accept scalars as arguments. +* :ghpull:`15711`: Don't explicitly list scalez kwarg in Axes3D constructor and docs. +* :ghpull:`14948`: Simplify Tick and Axis initialization. +* :ghpull:`15693`: Also test PySide2 on CI. +* :ghpull:`15701`: Tried to solve Issue #15650: Print URL when webbrowser.open Fails +* :ghpull:`15704`: Fix more broken refs. +* :ghpull:`15687`: Add tooltips to HTML animation controls +* :ghpull:`15592`: Offset text position +* :ghpull:`15697`: Fix some broken doc refs. +* :ghpull:`15700`: Parametrize some spectral tests. +* :ghpull:`15699`: Fix some incorrect ValueErrors. +* :ghpull:`15698`: Bump numpy dependency to >=1.15. +* :ghpull:`15694`: Handle upcoming deprecation of np.float. +* :ghpull:`15691`: Correctly handle high dpi in Pillow animation writer. +* :ghpull:`15676`: Doc adopt nep29 +* :ghpull:`15692`: Update FUNDING.yml +* :ghpull:`15645`: Bump minimal numpy version to 1.12. +* :ghpull:`15646`: Hide sphinx-gallery config comments +* :ghpull:`15642`: Remove interpolation="nearest" from most examples. +* :ghpull:`15671`: Don't mention tcl in tkagg commments anymore. +* :ghpull:`15607`: Simplify tk loader. +* :ghpull:`15651`: Simplify axes_pad handling in axes_grid. +* :ghpull:`15652`: Remove mention of Enthought Canopy from the docs. +* :ghpull:`15655`: Remove outdated license files. +* :ghpull:`15639`: Simplify axes_grid.Grid/axes_grid.ImageGrid construction. +* :ghpull:`15640`: Remove some commented-out code from axes_grid. +* :ghpull:`15643`: Fix examples claiming matplotlib can't plot np.datetime64. +* :ghpull:`15375`: Add note to hist docstring about speed +* :ghpull:`15461`: Fix invalid checks for axes_class parameter in ImageGrid. +* :ghpull:`15635`: Deprecate "U" mode passed to cbook.to_filehandle(). +* :ghpull:`15563`: In backend_pgf, directly open subprocess in utf8 mode. +* :ghpull:`15462`: Simplify azure setup. +* :ghpull:`13075`: Remove logic for optionally building Agg and TkAgg. +* :ghpull:`15262`: Declare qt figureoptions tool in toolitems. +* :ghpull:`15292`: Shorten RendererWx.get_wx_font. +* :ghpull:`15569`: Allow linking against a system qhull as well. +* :ghpull:`15589`: Make sure that figures are closed when check_figures_equal finishes +* :ghpull:`15465`: Validate and simplify set_tick_params(which=...) +* :ghpull:`15090`: Coerce MxNx1 images into MxN images for imshow +* :ghpull:`15578`: BLD: set the max line length on the flake8 config +* :ghpull:`15564`: Use True instead of 1 as filternorm default +* :ghpull:`15536`: Add a backend kwarg to savefig. +* :ghpull:`15571`: Cleanup following using Pillow as universal image reader +* :ghpull:`14650`: Change hist(cumulative=-1) to hist(cumulative='reversed') +* :ghpull:`15476`: Default to local_freetype builds. +* :ghpull:`15557`: Skip failing pgf test when sfmath.sty is not present. +* :ghpull:`15555`: Add pgf to list of builtin backends in docs. +* :ghpull:`15534`: BLD: update pillow dependency +* :ghpull:`15427`: Separate plots using #### in demo_fixed_size_axes.py +* :ghpull:`15505`: Cleanup axisartist tutorial. +* :ghpull:`15506`: Rename locator.den to the clearer locator.nbins in mpl_toolkits. +* :ghpull:`15502`: Get rid of trivial compiler warning. +* :ghpull:`15451`: Ci py38 +* :ghpull:`15484`: Cleanup docs regarding compilers. +* :ghpull:`15467`: Validate locator_params(axis=...) +* :ghpull:`15330`: Add axes method for drawing infinite lines. +* :ghpull:`15482`: Trivial style fixes to constrained_layout. +* :ghpull:`15418`: Use correct pip/pytest on azure +* :ghpull:`15466`: Update tick_params() docs +* :ghpull:`15463`: Remove staticbuild option from setup.cfg.template. +* :ghpull:`15378`: Don't link ft2font to zlib by default. +* :ghpull:`15270`: When no gui event loop is running, propagate callback exceptions. +* :ghpull:`15447`: Move testing of Py3.8 to Travis. +* :ghpull:`15431`: Fix range(len()) usages +* :ghpull:`15390`: Simplify implementation of vectorized date operations. +* :ghpull:`11086`: Changes to figure.clf() and suplot_adjust +* :ghpull:`15403`: Fix DeprecationWarning in nightly testing +* :ghpull:`15394`: Deprecate {NonUniformImage,PcolorImage}.is_grayscale. +* :ghpull:`15400`: Updated INSTALL.rst to correct install commands +* :ghpull:`13788`: Autoscale for ax.arrow() +* :ghpull:`15367`: Update the readme on providing API changes +* :ghpull:`15193`: Switch to using pillow for png as well. +* :ghpull:`15346`: vectorized calc_arrow loop in quiver +* :ghpull:`15011`: Adding example for drawstyle +* :ghpull:`15371`: Deprecate Colorbar.config_axis() +* :ghpull:`15361`: Update next API changes to new structure +* :ghpull:`15274`: NavigationToolbar2Tk: make packing optional. +* :ghpull:`15158`: Change the way API changes are documented +* :ghpull:`15356`: Fix broken imports. +* :ghpull:`15200`: Simplify SubplotParams.update(). +* :ghpull:`15210`: Explicitly list allowed "unused" imports, remove the rest. +* :ghpull:`15348`: Some figure and related docs cleanup +* :ghpull:`13355`: Simplify and generalize BezierSegment. +* :ghpull:`14917`: ENH: box aspect for axes +* :ghpull:`14949`: Use fix_minus in format_data_short. +* :ghpull:`15341`: Move non-gui warning message to backend_bases. +* :ghpull:`14589`: Add towncrier README and config +* :ghpull:`15335`: Add discourse link to readme +* :ghpull:`15293`: Fixes for wx savefig dialog. +* :ghpull:`15324`: Update PR guidelines +* :ghpull:`15301`: Update colorbar docs +* :ghpull:`15340`: Always attach a manager attribute (possibly None) on canvas. +* :ghpull:`15319`: Make validate_movie_writer actually check registered writers. +* :ghpull:`10973`: PGF: Replace \pgfimage by \includegraphics to fix \import regression +* :ghpull:`15302`: fix warning used by cbook.warn_deprecated() +* :ghpull:`15321`: Sort missing_references.json. +* :ghpull:`15290`: Unify fig.delaxes(ax) and ax.remove(). +* :ghpull:`15309`: Simplify sca(). +* :ghpull:`15201`: Autogenerate gca(), gci() from boilerplate.py. +* :ghpull:`15305`: Autogenerate footer Copyright year +* :ghpull:`15294`: Replace custom logging in wx by stdlib logging. +* :ghpull:`15288`: More properties aliases. +* :ghpull:`15286`: throw deprecation warning on empty call to fig.add_axes() +* :ghpull:`15282`: Colorbar cleanup. +* :ghpull:`15250`: Cleanup font_manager. +* :ghpull:`13581`: Cleanup _pylab_helpers. +* :ghpull:`15273`: DOC: don't use term units in transform tutorial +* :ghpull:`15263`: Correctly setup comparisons in test_compare_images. +* :ghpull:`15226`: Turn gtk3 pan/zoom button into togglable buttons. +* :ghpull:`14609`: Simplify implementation of set_{x,y}bound. +* :ghpull:`15261`: Change layout of test_triager to avoid cropping images. +* :ghpull:`15236`: Dedupe SubplotSpec construction in mpl_toolkits. +* :ghpull:`14130`: Add decorator to inherit keyword-only deprecations +* :ghpull:`15249`: In findfont(fallback_to_default=False), throw if default font is missing +* :ghpull:`15175`: Simplify pdf image output. +* :ghpull:`7506`: [WIP] Add Axes method for drawing infinite lines. + +Issues (165): + +* :ghissue:`9118`: make TeXManager more user-configurable +* :ghissue:`17646`: more conservative setattr_cm broke mplcairo +* :ghissue:`17634`: Cannot copy LinearSegmentedColormap +* :ghissue:`16496`: Single path optimisation for Collection w/ offsets broken +* :ghissue:`192`: Savefig does not issue a warning on a non-existent keyword n +* :ghissue:`17624`: _DummyAxis needs a __name__ attribute for ScalarFormatter +* :ghissue:`16910`: Axes.imshow draws invalid color at value is 0 when max of 'X' not equal to vmax +* :ghissue:`17637`: streamplot and sticky edges interaction +* :ghissue:`17633`: Stackplot fails for small numbers +* :ghissue:`17616`: waitforbuttonpress in Linux +* :ghissue:`17615`: small bug in documentation of backend.FigureCanvasBase.start_event_loop +* :ghissue:`17093`: Zero size figure use case +* :ghissue:`17608`: How avoid PyQt5 to crash when I move Qslitter to the edge with a matplotlib figure in it? +* :ghissue:`9829`: Vertices clipped for certain markers when plotting more than two points and saving as pdf +* :ghissue:`15815`: bar3d color length bug +* :ghissue:`15376`: ScalarFormatter.set_powerlimits documentation seems inconsistent +* :ghissue:`17595`: Master doc builds broken +* :ghissue:`16482`: Pyplot hlines and vlines do not use the 'lines.color' property in rcParams by default +* :ghissue:`16388`: rethink how we display DOI svg badges +* :ghissue:`17172`: set_aspect for 3D plots +* :ghissue:`16463`: Jupyter "inline" backend seems to misinterpret "figsize" with Axes3D +* :ghissue:`17527`: The markers are not hollow when I use ax.scatter() and set markers.MarkerStyle()'s fillstyle to 'none'. My usage is wrong? +* :ghissue:`7491`: sort out if the high-resolution ellipse code still works +* :ghissue:`17398`: Plotting an error band along a curve +* :ghissue:`8550`: Matplotlib chooses the wrong font for unrecognized weights +* :ghissue:`8788`: Font issue: findfonts should differentiate between thin and regular ttf fonts +* :ghissue:`10194`: legend is not present in the generated image if I use 'tight' for bbox_inches +* :ghissue:`17336`: set_url without effect for instances of Line2D +* :ghissue:`9695`: set_url() without effect in the plot for instances of Tick +* :ghissue:`17192`: How to change the thickness of the marker "x" when using scatter? +* :ghissue:`17507`: pyplot.savefig() throwing warning suggesting a bug (possibly in figManger) +* :ghissue:`17502`: dict unpacking broken for ``.plot`` in 3.2 +* :ghissue:`15546`: plt.imshow: clip_on=False has no effect +* :ghissue:`17023`: DOC: Tutorial/Sample plots should use same fig/axis creation method +* :ghissue:`7537`: Conflict between different AGG static libraries in a same binary +* :ghissue:`16836`: Dropping support for PyQt4; preparing support for PyQt6. +* :ghissue:`17455`: LightSource.shade fails on a masked array +* :ghissue:`16353`: BUG: VisibleDeprecationWarning in boxplot +* :ghissue:`11820`: Compressed Triangulation Masking in CubicTriInterpolator +* :ghissue:`11823`: Animation Examples +* :ghissue:`15410`: Change in OSX Catalina makes matplotlib + multiprocessing crash +* :ghissue:`17467`: Bug Report: saved Figure ignores figure.facecolor +* :ghissue:`17343`: Regression in add_subplot.. +* :ghissue:`7093`: ordering issues between ``set_xmargin`` and ``set_xscale`` +* :ghissue:`13971`: Unnecessary drawing with NbAgg +* :ghissue:`17432`: Scatter accepts marker=MarkerStyle(), but plot does not +* :ghissue:`15675`: Boxplot line color with style dark_background should be bright +* :ghissue:`5962`: No output from pyplot on cygwin64 python3 virtualenv +* :ghissue:`17393`: TexManager.get_rgba fails +* :ghissue:`5830`: Incorrect overlap of markers in scatter3D +* :ghissue:`11937`: Limiting ticks on colorbar axes falsify tick labels. +* :ghissue:`17354`: Converter detection fails for inkscape if on headless system without DISPLAY +* :ghissue:`17352`: Zoom In-Out not behaving as expected in QT backend example +* :ghissue:`15409`: Datetime plot fails with 'Agg' backend in interactive mode +* :ghissue:`14155`: Adding GridSpec.subplots? +* :ghissue:`16583`: matplotlibrc validates some parameters wrongly +* :ghissue:`16946`: Pick_event on AnnotationBbox fires at wrong position +* :ghissue:`15131`: set_size_inches doesn't resize window on macosx backend +* :ghissue:`7619`: Figure background colors +* :ghissue:`15899`: Describe possible kwargs that may be input into a function +* :ghissue:`17304`: constrained-layout gives wrong results when explicitly equal width ratios are set +* :ghissue:`17295`: DOC: https://matplotlib.org/api/_as_gen/matplotlib.quiver.Quiver.html +* :ghissue:`17294`: DOC: matplotlib.axes.Axes.annotate.html +* :ghissue:`17290`: backend_svg fails with dashed line style +* :ghissue:`16677`: tmp_config_or_cache_dir atexit cleanup fails after forks() +* :ghissue:`15091`: Turbo color map +* :ghissue:`7372`: Moving get_ax and do_event to testing +* :ghissue:`15225`: Show offset text on subplots after sharing axis +* :ghissue:`7138`: misplaced spines in dates plot +* :ghissue:`17243`: Misleading error message in _parse_scatter_color_args +* :ghissue:`16461`: Hexbin if singular and mincnt used +* :ghissue:`14596`: forward port jquery removal from ipympl +* :ghissue:`17217`: Transform operators are not publicly documented.... +* :ghissue:`2253`: matplotlib makes python lose focus +* :ghissue:`7184`: margins does not handle bézier curves +* :ghissue:`16830`: ``_path.get_extents`` does not correctly handle bezier curves +* :ghissue:`17176`: Print figure using PS backend is needlessly slow +* :ghissue:`17141`: flake8-docstrings does not check all of our requirements +* :ghissue:`16567`: Let legend get the handles from the provided objects if not specified explicitly. +* :ghissue:`16805`: Titles cannot be padded to negative numbers anymore. +* :ghissue:`17114`: ``add_axes`` shows deprecation warning when called with only ``kwarg``\s +* :ghissue:`16885`: Change return type get_{x,y}ticklabels to plain list +* :ghissue:`17044`: widgets.TextBox continuously creates new text objects and linecollection objects. +* :ghissue:`17066`: documentation of animation contains non-working code example +* :ghissue:`16588`: Rename next_api_changes to api_changes_3.x (whatever number makes sense) +* :ghissue:`17015`: ``get_major_ticks`` docs missing return type +* :ghissue:`16976`: Thin line color distortion on large scale +* :ghissue:`16934`: gtk3 window immediately resizes down to zero-height upon showing up. +* :ghissue:`16941`: test_determinism_check is failing (sometimes) +* :ghissue:`16982`: pyplot.rgrids don't do anything +* :ghissue:`16952`: How to solve an error of "ValueError: Key backend: Unrecognized backend string '"agg"' +* :ghissue:`15272`: Axes.violinplot has small issue in using pandas.DataFrame without index 0. +* :ghissue:`16926`: tk window immediately resizes down to zero-height upon showing up. +* :ghissue:`16919`: wx backends don't send close_event if window is closed via "q" keypress +* :ghissue:`16854`: small typo in the documentation +* :ghissue:`16895`: offset text still visible with ImageGrid axis "L" +* :ghissue:`12712`: Autoscale does not work for ax.arrow() +* :ghissue:`14208`: shift + w does not close all figures (has no effect) +* :ghissue:`15745`: Failed to add annotate to figure +* :ghissue:`11432`: Pressing the "1" key kills the zoom/pan tool +* :ghissue:`13799`: BUG: incorrect error bar colors when NaN values are present +* :ghissue:`16185`: hist demo appears to incorrectly mention ``normed`` and something odd about ``density`` as well. +* :ghissue:`15203`: Closing figures is done by number +* :ghissue:`16016`: Better argument checking of subplot definition in ``add_subplot()`` +* :ghissue:`15980`: Is the reset of the colorbar's edgecolor when updating the corresponding image clim wanted behaviour? +* :ghissue:`16718`: Float figure DPI +* :ghissue:`16498`: long string of format_coord in osx backend +* :ghissue:`8405`: BUG: PDF export seems wrong with dash sequences that include a None offset +* :ghissue:`8619`: Feature request: allow mathtext fallback font other than Computer Modern for custom mathtext setup +* :ghissue:`14996`: format error saving eps figure using custom linestyle +* :ghissue:`16493`: Example/tutorials warn due to new pcolormesh shading +* :ghissue:`16022`: Cleanup Artist.draw() signatures +* :ghissue:`16389`: “Size” ignored if placed before fontproperties +* :ghissue:`16687`: Creating a figure of size (0, 0) raises an error +* :ghissue:`12729`: Docs for contour levels argument is incorrect +* :ghissue:`16593`: specifying ecolor in errobar turns off cycling +* :ghissue:`15621`: secondary_xaxis doesn't seem to use formatters +* :ghissue:`16116`: travis36minver.txt needs an update +* :ghissue:`16546`: Problem with eventplot - error message claims events & lineoffsets are unequal sizes +* :ghissue:`16462`: Allow wedges of polar plots to include theta = 0. +* :ghissue:`15142`: pyplot.annotate() API deprecation +* :ghissue:`16479`: font-stretch property missing in svg export +* :ghissue:`14304`: 'NSWindow drag regions should only be invalidated on the Main Thread!' - macos/python +* :ghissue:`12085`: Tcl_AsyncDelete: async handler deleted by the wrong thread +* :ghissue:`14669`: cm.ScalarMappable should fail early when norm input is wrong +* :ghissue:`16468`: incorrect cbar minor ticks for extend regions when x/ytick.minor.visible is True +* :ghissue:`16243`: windows builds: devenv freetype /update appears not to have an effect +* :ghissue:`11525`: Axes3D scatter plot for Numpy arrays in F-order does not give correct z-values +* :ghissue:`8894`: mplot3d projection results in non-orthogonal axes +* :ghissue:`1104`: Resizing a GUI window with Axes3D +* :ghissue:`16371`: Incomplete documentation in axes_grid1 +* :ghissue:`6323`: Vertical alignment of tick labels with usetex=True +* :ghissue:`7957`: clabel not respecting zorder parameter +* :ghissue:`16252`: axes.spy plotting function doesn't respect origin='lower' kwarg when marker is not None +* :ghissue:`16299`: The interactive polar plot animation's axis label won't scale. +* :ghissue:`15182`: More tests ``ConciseDateFormatter`` needed +* :ghissue:`16140`: Unclear Documentation for get_xticklabels +* :ghissue:`16147`: pp.hist parmeter 'density' does not scale data appropriately +* :ghissue:`16069`: matplotlib glitch when rotating interactively a 3d animation +* :ghissue:`14603`: Scatterplot: should vmin/vmax be ignored when a norm is specified? +* :ghissue:`15730`: Setting lines.marker = s in matplotlibrc also sets markers in boxplots +* :ghissue:`11178`: home/back/forward buttons do nothing in 3d mode +* :ghissue:`14520`: pylab with wx backend not exiting cleanly +* :ghissue:`15964`: Guard ``plt.subplot`` kwargs a bit better? +* :ghissue:`15404`: Add python 3.8 tests +* :ghissue:`15773`: Warning:... GLib.source_remove(self._idle_draw_id) when using plt.savefig() +* :ghissue:`15923`: pie takes negative values +* :ghissue:`10317`: Setting plt.rc('text', usetex=True) after ticker.ScalarFormatter(useMathText=True) causes Error +* :ghissue:`15825`: Customised dashed linstyle in matplotlib.cycler throws ValueError when using in Axes.set_prop_cycle +* :ghissue:`9792`: Error with linestyles rcParams entries under the form (on, off, ...) and a style context manager +* :ghissue:`15782`: Invalid polygon in stepfilled histogram when bottom is set +* :ghissue:`15628`: Invalid unicode characters in PDF when font is a symlink +* :ghissue:`8577`: mplot3D scalar arguments for plot function +* :ghissue:`15650`: URL is not shown when webagg failed to open the browser. +* :ghissue:`5238`: the offset of the scientific notation in xaxis stays at bottom when axis is set to top +* :ghissue:`15678`: Error at save animation with pillow +* :ghissue:`15079`: check_figures_equal decorator reuses figures if called multiple times inside a single test. +* :ghissue:`15089`: Coerce MxNx1 images into MxN images for imshow +* :ghissue:`5253`: abline() - for drawing arbitrary lines on a plot, given specifications. +* :ghissue:`15165`: Switch to requiring Pillow rather than having our own png wrapper? +* :ghissue:`15280`: Add pull request checklist to Reviewers Guidlines +* :ghissue:`15289`: cbook.warn_deprecated() should warn with a MatplotlibDeprecationWarning not a UserWarning +* :ghissue:`15285`: DOC: make copy right year auto-update +* :ghissue:`15059`: fig.add_axes() with no arguments silently does nothing +* :ghissue:`14546`: Setting lines.markeredgecolor in rcParams affects the ticks' mark color too Previous GitHub Stats diff --git a/doc/users/index.rst b/doc/users/index.rst index 7afb7be62096..852ca4321e90 100644 --- a/doc/users/index.rst +++ b/doc/users/index.rst @@ -20,4 +20,5 @@ User's Guide github_stats.rst whats_new_old.rst license.rst + ../citing.rst credits.rst diff --git a/doc/users/interactive.rst b/doc/users/interactive.rst index 8c10d1250f3a..75101cb3bec7 100644 --- a/doc/users/interactive.rst +++ b/doc/users/interactive.rst @@ -9,22 +9,21 @@ .. toctree:: -When working with data it is often invaluable to be able to interact -with your plots. In many cases the built in pan/zoom and mouse-location -tools are sufficient, but you can also use the Matplotlib event system -to build customized data exploration tools. +When working with data, interactivity can be invaluable. 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. Matplotlib ships with :ref:`backends ` binding to several GUI toolkits (Qt, Tk, Wx, GTK, macOS, JavaScript) and third party packages provide bindings to `kivy `__ and `Jupyter Lab -`__. For the figures to be -"live" the GUI event loop will need to be integrated with your prompt. The -simplest way is to use IPython (see :ref:`below `). +`__. For the figures to be responsive to +mouse, keyboard, and paint events, the GUI event loop needs to be integrated +with an interactive prompt. We recommend using IPython (see :ref:`below `). -The `.pyplot` module provides functions for explicitly creating -Figures that include interactive tools, a toolbar, a tool-tip, and -:ref:`key bindings ` ready to go: +The `.pyplot` module provides functions for explicitly creating figures +that include interactive tools, a toolbar, a tool-tip, and +:ref:`key bindings `: `.pyplot.figure` Creates a new empty `.figure.Figure` or selects an existing figure @@ -36,13 +35,15 @@ Figures that include interactive tools, a toolbar, a tool-tip, and through `.pyplot.gcf` and a notion of "The Current Axes" accessed through `.pyplot.gca`. Almost all of the functions in `.pyplot` pass through the current `.Figure` / `.axes.Axes` (or create one) as -appropriate. Matplotlib keeps a reference to all of the open figures -created this way so they will not be garbage collected. You can close -and deregister `.Figure`\s from `.pyplot` individually via -`.pyplot.close` or close all open figures via ``plt.close('all')``. +appropriate. -For discussion of how the integration of the event loops and Matplotlib's event -system work under the hood see: +Matplotlib keeps a reference to all of the open figures +created via `pyplot.figure` or `pyplot.subplots` so that the figures will not be garbage +collected. `.Figure`\s can be closed and deregistered from `.pyplot` individually via +`.pyplot.close`; all open `.Figure`\s can be closed via ``plt.close('all')``. + + +For more discussion of Matplotlib's event system and integrated event loops, please read: .. toctree:: :maxdepth: 1 @@ -57,64 +58,58 @@ IPython integration =================== We recommend using IPython for an interactive shell. In addition to -all of its features (improved tab-completion, magics, -multiline editing, etc), it also ensures that the GUI toolkit event -loop is properly integrated with the command line (see -:ref:`cp_integration`). To configure the integration and enable -:ref:`interactive mode ` use the -``%matplotlib`` magic +all of its features (improved tab-completion, magics, multiline editing, etc), +it also ensures that the GUI toolkit event loop is properly integrated +with the command line (see :ref:`cp_integration`). + +In this example, we create and modify a figure via an IPython prompt. +The figure displays in a Qt5Agg GUI window. To configure the integration +and enable :ref:`interactive mode ` use the +``%matplotlib`` magic: .. highlight:: ipython :: - - user@machine:~ $ ipython - Python 3.8.2 (default, Apr 8 2020, 14:31:25) - Type 'copyright', 'credits' or 'license' for more information - IPython 7.13.0 -- An enhanced Interactive Python. Type '?' for help. - In [1]: %matplotlib Using matplotlib backend: Qt5Agg In [2]: import matplotlib.pyplot as plt -Calling +Create a new figure window: :: In [3]: fig, ax = plt.subplots() -will pop open a window for you and + +Add a line plot of the data to the window: :: In [4]: ln, = ax.plot(range(5)) -will show your data in the window. If you change something about the -line, for example the color +Change the color of the line from blue to orange: :: In [5]: ln.set_color('orange') -it will be reflected immediately. If you wish to disable this behavior -use +If you wish to disable automatic redrawing of the plot: :: In [6]: plt.ioff() -and +If you wish to re-enable automatic redrawing of the plot: :: In [7]: plt.ion() -re-enable it. -With recent versions of ``Matplotlib`` and ``IPython`` it is -sufficient to import `matplotlib.pyplot` and call `.pyplot.ion`, but -using the magic is guaranteed to work regardless of versions. +In recent versions of ``Matplotlib`` and ``IPython``, it is +sufficient to import `matplotlib.pyplot` and call `.pyplot.ion`. +Using the ``%`` magic is guaranteed to work in all versions of Matplotlib and IPython. .. highlight:: python @@ -146,45 +141,43 @@ Interactive mode controls: - whether created figures are automatically shown - whether changes to artists automatically trigger re-drawing existing figures -- whether `.pyplot.show` returns immediately or after all of the - figures have been closed when given no arguments - +- when `.pyplot.show()` returns if given no arguments: immediately, or after all of the figures have been closed -If in interactive mode, then: +If in interactive mode: -- newly created figures will be shown immediately -- figures will automatically redraw on change -- pyplot.show will return immediately by default +- newly created figures will be displayed immediately +- figures will automatically redraw when elements are changed +- `pyplot.show()` displays the figures and immediately returns -If not in interactive mode then: - -- newly created figures and changes to figures will - not be reflected until explicitly asked to be -- pyplot.show runs the GUI event loop and does not return until all of - the plot windows are closed +If not in interactive mode: +- newly created figures and changes to figures are not displayed until + * `.pyplot.show()` is called + * `.pyplot.pause()` is called + * `.FigureCanvasBase.flush_events()` is called +- `pyplot.show()` runs the GUI event loop and does not return until all the plot windows are closed If you are in non-interactive mode (or created figures while in non-interactive mode) you may need to explicitly call `.pyplot.show` -to bring the windows onto your screen. If you only want to run the -GUI event loop for a fixed amount of time you can use `.pyplot.pause`. -This will both block the progress of your code (as if you had called -`time.sleep`), ensure the current window is shown and if needed -re-drawn, and run the GUI event loop (so the windows are "live" for -interaction) for the specified period of time. - -Being in "interactive mode" is orthogonal to the GUI event loop being -integrated with your command prompt. If you use `pyplot.ion`, but -have not arranged for the event loop integration, your figures will -appear but will not be "live" while the prompt is waiting for input. +to display the windows on your screen. If you only want to run the +GUI event loop for a fixed amount of time, you can use `.pyplot.pause`. +This will block the progress of your code as if you had called +`time.sleep`, ensure the current window is shown and re-drawn if needed, +and run the GUI event loop for the specified period of time. + +The GUI event loop being integrated with your command prompt and +the figures being in interactive mode are independent of each other. +If you use `pyplot.ion` but have not arranged for the event loop integration, +your figures will appear but will not be interactive while the prompt is waiting for input. You will not be able to pan/zoom and the figure may not even render (the window might appear black, transparent, or as a snapshot of the desktop under it). Conversely, if you configure the event loop -integration, displayed figures will be "live" while waiting for input -at the prompt, regardless of pyplot's "interactive mode". In either -case, the figures will be "live" if you use -``pyplot.show(block=True)``, `.pyplot.pause`, or run the the GUI main -loop in some other way. +integration, displayed figures will be responsive while waiting for input +at the prompt, regardless of pyplot's "interactive mode". + +No matter what combination of interactive mode setting and event loop integration, +figures will be responsive if you use ``pyplot.show(block=True)``, `.pyplot.pause`, or run +the GUI main loop in some other way. .. warning:: @@ -201,7 +194,7 @@ Default UI The windows created by :mod:`~.pyplot` have an interactive toolbar with navigation -buttons and a readout of where the cursor is in dataspace. A number of +buttons and a readout of the data values the cursor is pointing at. A number of helpful keybindings are registered by default. @@ -240,8 +233,7 @@ Preserve aspect ratio hold **CONTROL** when panning/zooming with mo Other Python prompts ==================== -If you can not or do not want to use IPython, interactive mode works -in the vanilla python prompt +Interactive mode works in the default Python prompt: .. sourcecode:: pycon @@ -265,11 +257,11 @@ Jupyter Notebooks / Lab using an interactive backend. The default backend in notebooks, the inline backend, is not. `~ipykernel.pylab.backend_inline` renders the figure once and inserts a static image into the - notebook when the cell is executed. The images are static and can - not be panned / zoomed, take user input, or be updated from other + notebook when the cell is executed. Because the images are static, they + can not be panned / zoomed, take user input, or be updated from other cells. -To get interactive figures in the 'classic' notebook or jupyter lab +To get interactive figures in the 'classic' notebook or Jupyter lab, use the `ipympl `__ backend (must be installed separately) which uses the **ipywidget** framework. If ``ipympl`` is installed use the magic: @@ -280,25 +272,24 @@ If ``ipympl`` is installed use the magic: to select and enable it. -If you only need to use the classic notebook you can use +If you only need to use the classic notebook, you can use .. sourcecode:: ipython %matplotlib notebook -which uses the `.backend_nbagg` backend which ships with Matplotlib. -However nbagg does not work in Jupyter Lab. +which uses the `.backend_nbagg` backend provided by Matplotlib; +however, nbagg does not work in Jupyter Lab. -GUIs + jupyter +GUIs + Jupyter ~~~~~~~~~~~~~~ -If you are running your jupyter kernel locally you can use one of the -GUI backends. The process running your kernel will show a GUI window -on your desktop adjacent to your web browser. However if you move -that notebook to a remote server the kernel will try to open the GUI -window on *that* computer. Unless you have arranged to forward the -xserver back to your desktop, you not be able to see or interact with -the figure (if it does not raise an exception outright). +You can also use one of the non-``ipympl`` GUI backends in a Jupyter Notebook. +If you are running your Jupyter kernel locally, the GUI window will spawn on +your desktop adjacent to your web browser. If you run your notebook on a remote server, +the kernel will try to open the GUI window on the remote computer. Unless you have +arranged to forward the xserver back to your desktop, you will not be able to +see or interact with the window. It may also raise an exception. diff --git a/doc/users/interactive_guide.rst b/doc/users/interactive_guide.rst index 15c4854c81f2..645384c217e3 100644 --- a/doc/users/interactive_guide.rst +++ b/doc/users/interactive_guide.rst @@ -392,7 +392,7 @@ Eventloop integration mechanism CPython / readline ------------------ -The Python C API provides a hook, :c:var:`PyOS_InputHook`, to register a +The Python C API provides a hook, :c:data:`PyOS_InputHook`, to register a function to be run "The function will be called when Python's interpreter prompt is about to become idle and wait for user input from the terminal.". This hook can be used to integrate a second @@ -402,12 +402,11 @@ event queue, run the main loop for a short fixed amount of time, or run the event loop until a key is pressed on stdin. -Matplotlib does not currently do any management of -:c:var:`PyOS_InputHook` due to the wide range of ways that Matplotlib -is used. This management is left to downstream libraries -- either -user code or the shell. Interactive figures, even with matplotlib in -'interactive mode', may not work in the vanilla python repl if an -appropriate :c:var:`PyOS_InputHook` is not registered. +Matplotlib does not currently do any management of :c:data:`PyOS_InputHook` due +to the wide range of ways that Matplotlib is used. This management is left to +downstream libraries -- either user code or the shell. Interactive figures, +even with matplotlib in 'interactive mode', may not work in the vanilla python +repl if an appropriate :c:data:`PyOS_InputHook` is not registered. Input hooks, and helpers to install them, are usually included with the python bindings for GUI toolkits and may be registered on import. diff --git a/doc/users/next_whats_new/2017-12-08-axline.rst b/doc/users/next_whats_new/2017-12-08-axline.rst deleted file mode 100644 index f4ba4e0b3fa9..000000000000 --- a/doc/users/next_whats_new/2017-12-08-axline.rst +++ /dev/null @@ -1,5 +0,0 @@ -New `~.axes.Axes.axline` method -------------------------------- - -A new `~.axes.Axes.axline` method has been added to draw infinitely long lines -that pass through two points. diff --git a/doc/users/next_whats_new/2017-12-29-3dhome.rst b/doc/users/next_whats_new/2017-12-29-3dhome.rst deleted file mode 100644 index ae7b80a60978..000000000000 --- a/doc/users/next_whats_new/2017-12-29-3dhome.rst +++ /dev/null @@ -1,2 +0,0 @@ -Home/Forward/Backward buttons now work with 3D axes ---------------------------------------------------- diff --git a/doc/users/next_whats_new/2018-09-19-AL.rst b/doc/users/next_whats_new/2018-09-19-AL.rst deleted file mode 100644 index 77240958aa90..000000000000 --- a/doc/users/next_whats_new/2018-09-19-AL.rst +++ /dev/null @@ -1,11 +0,0 @@ -:orphan: - -`matplotlib.rc_context` is now a `contextlib.contextmanager` -```````````````````````````````````````````````````````````` - -`matplotlib.rc_context` can now be used as a decorator (technically, it is now -implemented as a `contextlib.contextmanager`), e.g. :: - - @rc_context({"lines.linewidth": 2}) - def some_function(...): - ... diff --git a/doc/users/next_whats_new/2019-03-25-mplot3d-projection.rst b/doc/users/next_whats_new/2019-03-25-mplot3d-projection.rst deleted file mode 100644 index d60a4a921c45..000000000000 --- a/doc/users/next_whats_new/2019-03-25-mplot3d-projection.rst +++ /dev/null @@ -1,9 +0,0 @@ -``Axes3D`` no longer distorts the 3d plot to match the 2d aspect ratio ----------------------------------------------------------------------- - -Plots made with :class:`~mpl_toolkits.mplot3d.axes3d.Axes3D` were previously -stretched to fit a square bounding box. As this stretching was done after -the projection from 3D to 2D, it resulted in distorted images if non-square -bounding boxes were used. - -As of this release, this no longer occurs. diff --git a/doc/users/next_whats_new/2019-06-01-AL.rst b/doc/users/next_whats_new/2019-06-01-AL.rst deleted file mode 100644 index fc3940bfb969..000000000000 --- a/doc/users/next_whats_new/2019-06-01-AL.rst +++ /dev/null @@ -1,11 +0,0 @@ -GridSpec.subplots() -``````````````````` - -The `.GridSpec` class gained a `~.GridSpecBase.subplots` method, so that one -can write :: - - fig.add_gridspec(2, 2, height_ratios=[3, 1]).subplots() - -as an alternative to :: - - fig.subplots(2, 2, gridspec_kw={"height_ratios": [3, 1]}) diff --git a/doc/users/next_whats_new/2019-06-25-AL.rst b/doc/users/next_whats_new/2019-06-25-AL.rst deleted file mode 100644 index 1b26539c0bc4..000000000000 --- a/doc/users/next_whats_new/2019-06-25-AL.rst +++ /dev/null @@ -1,2 +0,0 @@ -3D axes now support minor ticks -``````````````````````````````` diff --git a/doc/users/next_whats_new/2019-07-31_axes-box-aspect.rst b/doc/users/next_whats_new/2019-07-31_axes-box-aspect.rst deleted file mode 100644 index ca7650fbd496..000000000000 --- a/doc/users/next_whats_new/2019-07-31_axes-box-aspect.rst +++ /dev/null @@ -1,14 +0,0 @@ -:orphan: - -Setting axes box aspect ------------------------ - -It is now possible to set the aspect of an axes box directly via -`~.Axes.set_box_aspect`. The box aspect is the ratio between axes height -and axes width in physical units, independent of the data limits. -This is useful to e.g. produce a square plot, independent of the data it -contains, or to have a usual plot with the same axes dimensions next to -an image plot with fixed (data-)aspect. - -For use cases check out the :doc:`Axes box aspect -` example. diff --git a/doc/users/next_whats_new/2019-10-18_rcParams-for-raise-window-behavior.rst b/doc/users/next_whats_new/2019-10-18_rcParams-for-raise-window-behavior.rst deleted file mode 100644 index bc8c18cdfeae..000000000000 --- a/doc/users/next_whats_new/2019-10-18_rcParams-for-raise-window-behavior.rst +++ /dev/null @@ -1,8 +0,0 @@ -:orphan: - -rcParams for controlling default "raise window" behavior --------------------------------------------------------- -The new config option :rc:`figure.raise_window` allows to disable -raising the plot window when calling `~.pyplot.show` or `~.pyplot.pause`. -``MacOSX`` backend is currently not supported. - diff --git a/doc/users/next_whats_new/2019-10-27-savefig-backend.rst b/doc/users/next_whats_new/2019-10-27-savefig-backend.rst deleted file mode 100644 index 602278fed1d5..000000000000 --- a/doc/users/next_whats_new/2019-10-27-savefig-backend.rst +++ /dev/null @@ -1,6 +0,0 @@ -``savefig()`` gained a ``backend`` keyword argument ---------------------------------------------------- - -The ``backend`` keyword argument to ``savefig`` can now be used to pick the -rendering backend without having to globally set the backend; e.g. one can save -pdfs using the pgf backend with ``savefig("file.pdf", backend="pgf")``. diff --git a/doc/users/next_whats_new/2019-11-13-offset-text-position.rst b/doc/users/next_whats_new/2019-11-13-offset-text-position.rst deleted file mode 100644 index ac9e58058034..000000000000 --- a/doc/users/next_whats_new/2019-11-13-offset-text-position.rst +++ /dev/null @@ -1,4 +0,0 @@ -Offset text is now set to the top when using axis.tick_top() ------------------------------------------------------------- - -Solves the issue that the power indicator (e.g. 1e4) stayed on the bottom, even if the ticks were on the top. diff --git a/doc/users/next_whats_new/2019-12-09-legend-labelcolor.rst b/doc/users/next_whats_new/2019-12-09-legend-labelcolor.rst deleted file mode 100644 index bf22a22f09f9..000000000000 --- a/doc/users/next_whats_new/2019-12-09-legend-labelcolor.rst +++ /dev/null @@ -1,16 +0,0 @@ -Text color for legend labels ----------------------------- - -The text color of legend labels can now be set by passing a parameter -``labelcolor`` to `~.axes.Axes.legend`. The ``labelcolor`` keyword can be: - -* A single color (either a string or RGBA tuple), which adjusts the text color - of all the labels. -* A list or tuple, allowing the text color of each label to be set - individually. -* ``linecolor``, which sets the text color of each label to match the - corresponding line color. -* ``markerfacecolor``, which sets the text color of each label to match the - corresponding marker face color. -* ``markeredgecolor``, which sets the text color of each label to match the - corresponding marker edge color. diff --git a/doc/users/next_whats_new/2019-12-20-set_xy_position b/doc/users/next_whats_new/2019-12-20-set_xy_position deleted file mode 100644 index 5e125673516b..000000000000 --- a/doc/users/next_whats_new/2019-12-20-set_xy_position +++ /dev/null @@ -1,7 +0,0 @@ -Align labels to axes edges --------------------------- -`~.axes.Axes.set_xlabel`, `~.axes.Axes.set_ylabel` and `ColorbarBase.set_label` -support a parameter ``loc`` for simplified positioning. Supported values are -'left', 'center', or 'right'. The default is controlled via -:rc:`xaxis.labelposition` and :rc:`yaxis.labelposition`; the Colorbar label -takes the rcParam based on its orientation. diff --git a/doc/users/next_whats_new/2020-01-18-pcolorshadingoptions.rst b/doc/users/next_whats_new/2020-01-18-pcolorshadingoptions.rst deleted file mode 100644 index a61d5f4f4c6a..000000000000 --- a/doc/users/next_whats_new/2020-01-18-pcolorshadingoptions.rst +++ /dev/null @@ -1,25 +0,0 @@ -Pcolor and Pcolormesh now accept shading='nearest' and 'auto' -------------------------------------------------------------- - -Previously `.axes.Axes.pcolor` and `.axes.Axes.pcolormesh` handled -the situation where *x* and *y* have the same (respective) size as *C* by -dropping the last row and column of *C*, and *x* and *y* are regarded as the -edges of the remaining rows and columns in *C*. However, many users want -*x* and *y* centered on the rows and columns of *C*. - -To accommodate this, ``shading='nearest'`` and ``shading='auto'`` are -new allowed strings for the ``shading`` kwarg. ``'nearest'`` will center the -color on *x* and *y* if *x* and *y* have the same dimensions as *C* -(otherwise an error will be thrown). ``shading='auto'`` will choose 'flat' -or 'nearest' based on the size of *X*, *Y*, *C*. - -If ``shading='flat'`` then *X*, and *Y* should have dimensions one larger -than *C*. If *X* and *Y* have the same dimensions as *C*, then the previous -behavior is used and the last row and column of *C* are dropped, and a -DeprecationWarning is emitted. - -Users can also specify this by the new :rc:`pcolor.shading` in their -``.matplotlibrc`` or via `.rcParams`. - -See :doc:`pcolormesh ` -for examples. diff --git a/doc/users/next_whats_new/2020-01-24-lateshare.rst b/doc/users/next_whats_new/2020-01-24-lateshare.rst deleted file mode 100644 index fdb17c85a01a..000000000000 --- a/doc/users/next_whats_new/2020-01-24-lateshare.rst +++ /dev/null @@ -1,8 +0,0 @@ -`.Axes.sharex`, `.Axes.sharey` ------------------------------- -These new methods allow sharing axes *immediately* after creating them. For -example, they can be used to selectively link some axes created all together -using `~.Figure.subplots`. - -Note that they may *not* be used to share axes after any operation (e.g., -drawing) has occurred on them. diff --git a/doc/users/next_whats_new/2020-01-25-clabel_zorder.rst b/doc/users/next_whats_new/2020-01-25-clabel_zorder.rst deleted file mode 100644 index c5518a44023c..000000000000 --- a/doc/users/next_whats_new/2020-01-25-clabel_zorder.rst +++ /dev/null @@ -1,9 +0,0 @@ -Set zorder of contour labels ----------------------------- -`~.axes.Axes.clabel` now accepts a ``zorder`` kwarg -making it easier to set the ``zorder`` of contour labels. -If not specified, the default ``zorder`` of clabels used to always be 3 -(i.e. the default ``zorder`` of `~.text.Text`) irrespective of the ``zorder`` -passed to `~.axes.Axes.contour`/`~.axes.Axes.contourf`. -The new default ``zorder`` for clabels has been changed to (2 + ``zorder`` -passed to `~.axes.Axes.contour`/`~.axes.Axes.contourf`). diff --git a/doc/users/next_whats_new/2020-02-03-fontpath.rst b/doc/users/next_whats_new/2020-02-03-fontpath.rst deleted file mode 100644 index d2d16aea50c8..000000000000 --- a/doc/users/next_whats_new/2020-02-03-fontpath.rst +++ /dev/null @@ -1,5 +0,0 @@ -Simple syntax to select fonts by absolute path -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Fonts can now be selected by passing an absolute `pathlib.Path` to the *font* -kwarg of `.Text`. diff --git a/doc/users/next_whats_new/2020-02-24-mathtext-fallback.rst b/doc/users/next_whats_new/2020-02-24-mathtext-fallback.rst deleted file mode 100644 index a297867c6f0a..000000000000 --- a/doc/users/next_whats_new/2020-02-24-mathtext-fallback.rst +++ /dev/null @@ -1,5 +0,0 @@ -Add generalized "mathtext.fallback" rcParam ------------------------------------------------------------------------- -New "mathtext.fallback" rcParam. Takes "cm", "stix", "stixsans" -or "none" to turn fallback off. "mathtext.fallback_to_cm" is -deprecated, but if used, will override new fallback. \ No newline at end of file diff --git a/doc/users/next_whats_new/2020-03-05_markerstyle-for-lines.rst b/doc/users/next_whats_new/2020-03-05_markerstyle-for-lines.rst deleted file mode 100644 index 81dbec49c7fc..000000000000 --- a/doc/users/next_whats_new/2020-03-05_markerstyle-for-lines.rst +++ /dev/null @@ -1,7 +0,0 @@ -Lines now accept ``MarkerStyle`` instances as input ---------------------------------------------------- -Similar to `~.Axes.scatter`, `~.Axes.plot` and `~.lines.Line2D` now accept -`~.markers.MarkerStyle` instances as input for the *marker* parameter:: - - plt.plot(..., marker=matplotlib.markers.MarkerStyle("D")) - diff --git a/doc/users/next_whats_new/2020-03-06-auto-tick-formatters.rst b/doc/users/next_whats_new/2020-03-06-auto-tick-formatters.rst deleted file mode 100644 index d6c526513d0c..000000000000 --- a/doc/users/next_whats_new/2020-03-06-auto-tick-formatters.rst +++ /dev/null @@ -1,7 +0,0 @@ -Allow tick formatters to be set with str or function inputs ------------------------------------------------------------------------- -`~.Axis.set_major_formatter` and `~.Axis.set_minor_formatter` -now accept `str` or function inputs in addition to `~.ticker.Formatter` -instances. For a `str` a `~.ticker.StrMethodFormatter` is automatically -generated and used. For a function a `~.ticker.FuncFormatter` is automatically -generated and used. diff --git a/doc/users/next_whats_new/2020-03-15-cursor-sigdigits.rst b/doc/users/next_whats_new/2020-03-15-cursor-sigdigits.rst deleted file mode 100644 index d340a3111d5a..000000000000 --- a/doc/users/next_whats_new/2020-03-15-cursor-sigdigits.rst +++ /dev/null @@ -1,6 +0,0 @@ -Cursor text now uses a number of significant digits matching pointing precision -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Previously, the x/y position displayed by the cursor text would usually include -far more significant digits than the mouse pointing precision (typically one -pixel). This is now fixed for linear scales. diff --git a/doc/users/next_whats_new/2020-03-16-qtzoom.rst b/doc/users/next_whats_new/2020-03-16-qtzoom.rst deleted file mode 100644 index e3c2ece521fb..000000000000 --- a/doc/users/next_whats_new/2020-03-16-qtzoom.rst +++ /dev/null @@ -1,4 +0,0 @@ -Qt zoom rectangle now black and white -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -This makes it visible even over a dark background. diff --git a/doc/users/next_whats_new/2020-03-24-svg-hatch-alpha.rst b/doc/users/next_whats_new/2020-03-24-svg-hatch-alpha.rst deleted file mode 100644 index 06e53cf5db1c..000000000000 --- a/doc/users/next_whats_new/2020-03-24-svg-hatch-alpha.rst +++ /dev/null @@ -1,6 +0,0 @@ -The SVG backend can now render hatches with transparency --------------------------------------------------------- - -The SVG backend now respects the hatch stroke alpha. Useful applications are, -among others, semi-transparent hatches as a subtle way to differentiate columns -in bar plots. diff --git a/doc/users/next_whats_new/2020-03-31-path-size-methods.rst b/doc/users/next_whats_new/2020-03-31-path-size-methods.rst deleted file mode 100644 index d2347fb3b9e5..000000000000 --- a/doc/users/next_whats_new/2020-03-31-path-size-methods.rst +++ /dev/null @@ -1,27 +0,0 @@ - -Functions to compute a Path's size ----------------------------------- - -Various functions were added to `~.bezier.BezierSegment` and `~.path.Path` to -allow computation of the shape/size of a `~.path.Path` and its composite Bezier -curves. - -In addition to the fixes below, `~.bezier.BezierSegment` has gained more -documentation and usability improvements, including properties that contain its -dimension, degree, control_points, and more. - -Better interface for Path segment iteration -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -`~.path.Path.iter_bezier` iterates through the `~.bezier.BezierSegment`'s that -make up the Path. This is much more useful typically than the existing -`~.path.Path.iter_segments` function, which returns the absolute minimum amount -of information possible to reconstruct the Path. - -Fixed bug that computed a Path's Bbox incorrectly -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Historically, `~.path.Path.get_extents` has always simply returned the Bbox of -a curve's control points, instead of the Bbox of the curve itself. While this is -a correct upper bound for the path's extents, it can differ dramatically from -the Path's actual extents for non-linear Bezier curves. diff --git a/doc/users/next_whats_new/2020-04-09-datetime-epoch-change.rst b/doc/users/next_whats_new/2020-04-09-datetime-epoch-change.rst deleted file mode 100644 index 11b1a244bd43..000000000000 --- a/doc/users/next_whats_new/2020-04-09-datetime-epoch-change.rst +++ /dev/null @@ -1,22 +0,0 @@ -Dates now use a modern epoch ----------------------------- - -Matplotlib converts dates to days since an epoch using `.dates.date2num` (via -`matplotlib.units`). Previously, an epoch of ``0000-12-31T00:00:00`` was used -so that ``0001-01-01`` was converted to 1.0. An epoch so distant in the -past meant that a modern date was not able to preserve microseconds because -2000 years times the 2^(-52) resolution of a 64-bit float gives 14 -microseconds. - -Here we change the default epoch to the more reasonable UNIX default of -``1970-01-01T00:00:00`` which for a modern date has 0.35 microsecond -resolution. (Finer resolution is not possible because we rely on -`datetime.datetime` for the date locators). Access to the epoch is provided -by `~.dates.get_epoch`, and there is a new :rc:`date.epoch` rcParam. The user -may also call `~.dates.set_epoch`, but it must be set *before* any date -conversion or plotting is used. - -If you have data stored as ordinal floats in the old epoch, a simple -conversion (using the new epoch) is:: - - new_ordinal = old_ordinal + mdates.date2num(np.datetime64('0000-12-31')) diff --git a/doc/users/next_whats_new/2020-04-13-AL.rst b/doc/users/next_whats_new/2020-04-13-AL.rst deleted file mode 100644 index 890ceda6bf85..000000000000 --- a/doc/users/next_whats_new/2020-04-13-AL.rst +++ /dev/null @@ -1,7 +0,0 @@ -`.backend_bases.key_press_handler` and `.backend_bases.button_press_handler` simplifications -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -These event handlers can now be directly connected to a canvas with -``canvas.mpl_connect("key_press_event", key_press_handler)`` and -``canvas.mpl_connect("button_press_event", button_press_handler)``, rather than -having to write wrapper functions that fill in the (now optional) *canvas* and -*toolbar* parameters. diff --git a/doc/users/next_whats_new/2020-04-14-title-yparam.rst b/doc/users/next_whats_new/2020-04-14-title-yparam.rst deleted file mode 100644 index 53e98f1fe52b..000000000000 --- a/doc/users/next_whats_new/2020-04-14-title-yparam.rst +++ /dev/null @@ -1,8 +0,0 @@ -`~.axes.Axes.set_title` gains a y keyword argument to control auto positioning ------------------------------------------------------------------------------- -`~.axes.Axes.set_title` tries to auto-position the title to avoid any -decorators on the top x-axis. This is not always desirable so now -*y* is an explicit keyword argument of `~.axes.Axes.set_title`. It -defaults to *None* which means to use auto-positioning. If a value is -supplied (i.e. the pre-3.0 default was ``y=1.0``) then auto-positioning is -turned off. This can also be set with the new rcParameter :rc:`axes.titley`. diff --git a/doc/users/next_whats_new/2020-04-22-suptitle-tl.rst b/doc/users/next_whats_new/2020-04-22-suptitle-tl.rst deleted file mode 100644 index aee6a2c312cb..000000000000 --- a/doc/users/next_whats_new/2020-04-22-suptitle-tl.rst +++ /dev/null @@ -1,2 +0,0 @@ -tight_layout now supports suptitle -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/doc/users/next_whats_new/2020-04-26-merged-rasterizations.rst b/doc/users/next_whats_new/2020-04-26-merged-rasterizations.rst new file mode 100644 index 000000000000..d6ad7c4a4d0e --- /dev/null +++ b/doc/users/next_whats_new/2020-04-26-merged-rasterizations.rst @@ -0,0 +1,13 @@ +Consecutive rasterized draws now merged +--------------------------------------- + +Elements of a vector output can be individually set to rasterized, using +the ``rasterized`` keyword, or `~.artist.Artist.set_rasterized()`. This can +be useful to reduce file sizes. For figures with multiple raster elements +they are now automatically merged into a smaller number of bitmaps where +this will not effect the visual output. For cases with many elements this +can result in significantly smaller file sizes. + +To ensure this happens do not place vector elements between raster ones. + +To inhibit this merging set ``Figure.suppressComposite`` to True. diff --git a/doc/users/next_whats_new/2020-05-04-add-rcparams-contour-linewidth.rst b/doc/users/next_whats_new/2020-05-04-add-rcparams-contour-linewidth.rst deleted file mode 100644 index fd77f92fda14..000000000000 --- a/doc/users/next_whats_new/2020-05-04-add-rcparams-contour-linewidth.rst +++ /dev/null @@ -1,9 +0,0 @@ -Add :rc:`contour.linewidth` to rcParams ---------------------------------------- - -The new config option :rc:`contour.linewidth` allows to control the default -linewidth of contours as a float. When set to ``None``, the linewidths fall -back to :rc:`lines.linewidth`. The config value is overidden as usual -by the ``linewidths`` argument passed to `~.axes.Axes.contour` when -it is not set to ``None``. - diff --git a/doc/users/next_whats_new/2020-05-26-cl-subplot.rst b/doc/users/next_whats_new/2020-05-26-cl-subplot.rst new file mode 100644 index 000000000000..0031cc6656b6 --- /dev/null +++ b/doc/users/next_whats_new/2020-05-26-cl-subplot.rst @@ -0,0 +1,21 @@ +Subplot and subplot2grid can now work with constrained layout +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +``constrained_layout`` depends on a single ``GridSpec`` +for each logical layout on a figure. Previously, ``plt.subplot`` and +``plt.subplot2grid`` added a new ``GridSpec`` each time they were called and +were therefore incompatible with ``constrained_layout``. + +Now ``plt.subplot`` attempts to reuse the ``GridSpec`` if the number of rows +and columns is the same as the top level gridspec already in the figure. +i.e. ``plt.subplot(2, 1, 2)`` will use the same gridspec as +``plt.subplot(2, 1, 1)`` and the ``constrained_layout=True`` option to +`~.figure.Figure` will work. + +In contrast, mixing ``nrows`` and ``ncols`` will *not* work with +``constrained_lyaout``: ``plt.subplot(2, 2, 1)`` followed by +``plt.subplots(2, 1, 2)`` will still produce two gridspecs, and +``constrained_layout=True`` will give bad results. In order to get the +desired effect, the second call can specify the cells the second axes is meant +to cover: ``plt.subplots(2, 2, (2, 4))``, or the more pythonic +``plt.subplot2grid((2, 2), (0, 1), rowspan=2)`` can be used. diff --git a/doc/users/next_whats_new/README.rst b/doc/users/next_whats_new/README.rst index e29acc0f00a9..6555d229a1b5 100644 --- a/doc/users/next_whats_new/README.rst +++ b/doc/users/next_whats_new/README.rst @@ -1,7 +1,7 @@ :orphan: -What's new in unreleased Matplotlib? -==================================== +Instructions for writing "What's new" entries +============================================= Please place new portions of `whats_new.rst` in the `next_whats_new` directory. @@ -9,7 +9,11 @@ When adding an entry please look at the currently existing files to see if you can extend any of them. If you create a file, name it something like :file:`cool_new_feature.rst` if you have added a brand new feature or something like :file:`updated_feature.rst` for extensions of -existing features. Include contents of the form: :: +existing features. + +Please avoid using references in section titles, as it causes links to be +confusing in the table of contents. Instead, ensure that a reference is +included in the descriptive text. Include contents of the form: :: Section Title for Feature ------------------------- diff --git a/doc/users/next_whats_new/bar_hatches.rst b/doc/users/next_whats_new/bar_hatches.rst new file mode 100644 index 000000000000..532ded3e67f7 --- /dev/null +++ b/doc/users/next_whats_new/bar_hatches.rst @@ -0,0 +1,14 @@ +A list of hatches can be specified to `~.axes.Axes.bar` and `~.axes.Axes.barh` +------------------------------------------------------------------------------ + +Similar to some other rectangle properties, it is now possible to hand a list +of hatch styles to `~.axes.Axes.bar` and `~.axes.Axes.barh` in order to create +bars with different hatch styles, e.g. + +.. plot:: + + import matplotlib.pyplot as plt + + fig, ax = plt.subplots() + ax.bar([1, 2], [2, 3], hatch=['+', 'o']) + plt.show() diff --git a/doc/users/next_whats_new/colorbar_position.rst b/doc/users/next_whats_new/colorbar_position.rst new file mode 100644 index 000000000000..93fc833952b4 --- /dev/null +++ b/doc/users/next_whats_new/colorbar_position.rst @@ -0,0 +1,5 @@ +Gridspec-based colorbars can now be positioned above or to the left of the main axes +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +... by passing ``location="top"`` or ``location="left"`` to the ``colorbar()`` +call. diff --git a/doc/users/next_whats_new/colormap_repr.rst b/doc/users/next_whats_new/colormap_repr.rst new file mode 100644 index 000000000000..077f6fca12e9 --- /dev/null +++ b/doc/users/next_whats_new/colormap_repr.rst @@ -0,0 +1,6 @@ +IPython representations for Colormap objects +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +The `matplotlib.colors.Colormap` object now has image representations for +IPython / Jupyter backends. Cells returning a color map on the last line will +display an image of the color map. diff --git a/doc/users/next_whats_new/imshow_m_n_1.rst b/doc/users/next_whats_new/imshow_m_n_1.rst deleted file mode 100644 index 5cdc4d92a8f4..000000000000 --- a/doc/users/next_whats_new/imshow_m_n_1.rst +++ /dev/null @@ -1,5 +0,0 @@ -Imshow now coerces 3D arrays with depth 1 to 2D ------------------------------------------------- -Starting from this version arrays of size MxNx1 will be coerced into MxN -for displaying. This means commands like ``plt.imshow(np.random.rand(3, 3, 1))`` -will no longer return an error message that the image shape is invalid. diff --git a/doc/users/next_whats_new/pausing_animations.rst b/doc/users/next_whats_new/pausing_animations.rst new file mode 100644 index 000000000000..692e187d9580 --- /dev/null +++ b/doc/users/next_whats_new/pausing_animations.rst @@ -0,0 +1,6 @@ +Pausing and Resuming Animations +------------------------------- +The `.animation.Animation.pause` and `.animation.Animation.resume` methods +allow you to pause and resume animations. These methods can be used as callbacks +for event listeners on UI elements so that your plots can have some playback +control UI. diff --git a/doc/users/next_whats_new/pcolormesh_alpha_improvement.rst b/doc/users/next_whats_new/pcolormesh_alpha_improvement.rst new file mode 100644 index 000000000000..8b9ec98e7b85 --- /dev/null +++ b/doc/users/next_whats_new/pcolormesh_alpha_improvement.rst @@ -0,0 +1,40 @@ +pcolormesh has improved transparency handling by enabling snapping +------------------------------------------------------------------ + +Due to how the snapping keyword argument was getting passed to the AGG backend, +previous versions of Matplotlib would appear to show lines between the grid +edges of a mesh with transparency. This version now applies snapping +by default. To restore the old behavior (e.g., for test images), you may set +:rc:`pcolormesh.snap` to `False`. + +.. plot:: + + import matplotlib.pyplot as plt + import numpy as np + + # Use old pcolormesh snapping values + plt.rcParams['pcolormesh.snap'] = False + fig, ax = plt.subplots() + xx, yy = np.meshgrid(np.arange(10), np.arange(10)) + z = (xx + 1) * (yy + 1) + mesh = ax.pcolormesh(xx, yy, z, shading='auto', alpha=0.5) + fig.colorbar(mesh, orientation='vertical') + ax.set_title('Before (pcolormesh.snap = False)') + +Note that there are lines between the grid boundaries of the main plot which +are not the same transparency. The colorbar also shows these lines when a +transparency is added to the colormap because internally it uses pcolormesh +to draw the colorbar. With snapping on by default (below), the lines +at the grid boundaries disappear. + +.. plot:: + + import matplotlib.pyplot as plt + import numpy as np + + fig, ax = plt.subplots() + xx, yy = np.meshgrid(np.arange(10), np.arange(10)) + z = (xx + 1) * (yy + 1) + mesh = ax.pcolormesh(xx, yy, z, shading='auto', alpha=0.5) + fig.colorbar(mesh, orientation='vertical') + ax.set_title('After (default: pcolormesh.snap = True)') diff --git a/doc/users/next_whats_new/rcparams_dates.rst b/doc/users/next_whats_new/rcparams_dates.rst new file mode 100644 index 000000000000..370271a99e6b --- /dev/null +++ b/doc/users/next_whats_new/rcparams_dates.rst @@ -0,0 +1,31 @@ +New rcParams for dates: set converter and whether to use interval_multiples +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +The new :rc:`date.converter` allows toggling between +`matplotlib.dates.DateConverter` and `matplotlib.dates.ConciseDateConverter` +using the strings 'auto' and 'concise' respectively. + +The new :rc:`date.interval_multiples` allows toggling between the dates +locator trying to pick ticks at set intervals (i.e. day 1 and 15 of the +month), versus evenly spaced ticks that start where ever the +timeseries starts: + +.. plot:: + :include-source: True + + import matplotlib.pyplot as plt + import numpy as np + + dates = np.arange('2001-01-10', '2001-05-23', dtype='datetime64[D]') + y = np.sin(dates.astype(float) / 10) + fig, axs = plt.subplots(nrows=2, constrained_layout=True) + + plt.rcParams['date.converter'] = 'concise' + plt.rcParams['date.interval_multiples'] = True + ax = axs[0] + ax.plot(dates, y) + + plt.rcParams['date.converter'] = 'auto' + plt.rcParams['date.interval_multiples'] = False + ax = axs[1] + ax.plot(dates, y) diff --git a/doc/users/next_whats_new/set_colors_ticks_and_ticklabels_rcparams.rst b/doc/users/next_whats_new/set_colors_ticks_and_ticklabels_rcparams.rst new file mode 100644 index 000000000000..afa4bc3f01ea --- /dev/null +++ b/doc/users/next_whats_new/set_colors_ticks_and_ticklabels_rcparams.rst @@ -0,0 +1,30 @@ +The color of ticks and tick labels can be set independently using rcParams +-------------------------------------------------------------------------- + +Previously, :rc:`xtick.color` used to define the tick color and the label color. +The label color can now be set independently using +:rc:`xtick.labelcolor`. It defaults to "inherit" which will take the value +from :rc:`xtick.color`. The same holds for ``ytick.[label]color``. +For instance, to set the ticks to light grey and the tick labels +to black, one can use the following code in a script:: + + + import matplotlib as mpl + + mpl.rcParams['xtick.labelcolor'] = 'lightgrey' + mpl.rcParams['xtick.color'] = 'black' + mpl.rcParams['ytick.labelcolor'] = 'lightgrey' + mpl.rcParams['ytick.color'] = 'black' + + +Or by adding the following lines to the +:ref:`matplotlib rc ` file: or a +matplotlib style file: + + +.. code-block:: none + + xtick.labelcolor : lightgrey + xtick.color : black + ytick.labelcolor : lightgrey + ytick.color : black diff --git a/doc/users/prev_whats_new/github_stats_3.1.2.rst b/doc/users/prev_whats_new/github_stats_3.1.2.rst index 9b6356f3a120..9f11f34cb78a 100644 --- a/doc/users/prev_whats_new/github_stats_3.1.2.rst +++ b/doc/users/prev_whats_new/github_stats_3.1.2.rst @@ -1,7 +1,7 @@ -.. _github-stats_3-1-2: +.. _github-stats-3-1-2: -GitHub Stats -============ +GitHub Stats for Matplotlib 3.1.2 +================================= GitHub stats for 2019/05/18 - 2019/06/30 (tag: v3.1.0) diff --git a/doc/users/prev_whats_new/github_stats_3.2.0.rst b/doc/users/prev_whats_new/github_stats_3.2.0.rst index 2c6562a50ba2..f5cee3ad245c 100644 --- a/doc/users/prev_whats_new/github_stats_3.2.0.rst +++ b/doc/users/prev_whats_new/github_stats_3.2.0.rst @@ -1,7 +1,7 @@ .. _github-stats-3-2-0: -GitHub Stats -============ +GitHub Stats for Matplotlib 3.2.0 +================================= GitHub stats for 2019/05/18 - 2020/03/03 (tag: v3.1.0) diff --git a/doc/users/prev_whats_new/github_stats_3.2.1.rst b/doc/users/prev_whats_new/github_stats_3.2.1.rst new file mode 100644 index 000000000000..ec95cf4a7887 --- /dev/null +++ b/doc/users/prev_whats_new/github_stats_3.2.1.rst @@ -0,0 +1,98 @@ +.. _github-stats-3-2-1: + +GitHub Stats for Matplotlib 3.2.1 +================================= + +GitHub stats for 2020/03/03 - 2020/03/17 (tag: v3.2.0) + +These lists are automatically generated, and may be incomplete or contain duplicates. + +We closed 11 issues and merged 52 pull requests. +The full list can be seen `on GitHub `__ +and `on GitHub `__ + +The following 12 authors contributed 154 commits. + +* Amy Roberts +* Antony Lee +* Elliott Sales de Andrade +* hannah +* Hugo van Kemenade +* Jody Klymak +* Kyle Sunden +* MarcoGorelli +* Maximilian Nöthe +* Sandro Tosi +* Thomas A Caswell +* Tim Hoffmann + +GitHub issues and pull requests: + +Pull Requests (52): + +* :ghpull:`15199`: MNT/TST: generalize check_figures_equal to work with pytest.marks +* :ghpull:`15685`: Avoid a RuntimeError at animation shutdown with PySide2. +* :ghpull:`15969`: Restart pgf's latex instance after bad latex inputs. +* :ghpull:`16640`: ci: Fix Azure on v3.2.x +* :ghpull:`16648`: Document filling of Poly3DCollection +* :ghpull:`16649`: Fix typo in docs +* :ghpull:`16650`: Backport PR #16649 on branch v3.2.x (Fix typo in docs) +* :ghpull:`16651`: Docs: Change Python 2 note to past tense +* :ghpull:`16654`: Backport PR #16651 on branch v3.2.0-doc (Docs: Change Python 2 note to past tense) +* :ghpull:`16656`: Make test_imagegrid_cbar_mode_edge less flaky. +* :ghpull:`16661`: added Framework :: Matplotlib to setup +* :ghpull:`16665`: Backport PR #16661 on branch v3.2.x (added Framework :: Matplotlib to setup) +* :ghpull:`16671`: Fix some readme bits +* :ghpull:`16672`: Update CircleCI and add direct artifact link +* :ghpull:`16682`: Avoid floating point rounding causing bezier.get_parallels to fail +* :ghpull:`16690`: Backport PR #16682 on branch v3.2.x (Avoid floating point rounding causing bezier.get_parallels to fail) +* :ghpull:`16693`: TST: use pytest name in naming files for check_figures_equal +* :ghpull:`16695`: Restart pgf's latex instance after bad latex inputs. +* :ghpull:`16705`: Backport PR #16656 on branch v3.2.x (Make test_imagegrid_cbar_mode_edge less flaky.) +* :ghpull:`16708`: Backport PR #16671: Fix some readme bits +* :ghpull:`16709`: Fix saving PNGs to file objects in some places +* :ghpull:`16722`: Deprecate rcParams["datapath"] in favor of mpl.get_data_path(). +* :ghpull:`16725`: TST/CI: also try to run test_user_fonts_win32 on azure +* :ghpull:`16734`: Disable draw_foo methods on renderer used to estimate tight extents. +* :ghpull:`16735`: Make test_stem less flaky. +* :ghpull:`16736`: xpdf: Set AutoRotatePages to None, not false. +* :ghpull:`16742`: nbagg: Don't send events if manager is disconnected. +* :ghpull:`16745`: Allow numbers to set uvc for all arrows in quiver.set_UVC, fixes #16743 +* :ghpull:`16751`: Backport PR #16742 on branch v3.2.x (nbagg: Don't send events if manager is disconnected.) +* :ghpull:`16752`: ci: Disallow pytest 5.4.0, which is crashing. +* :ghpull:`16753`: Backport #16752 to v3.2.x +* :ghpull:`16760`: Backport PR #16735 on branch v3.2.x (Make test_stem less flaky.) +* :ghpull:`16761`: Backport PR #16745 on branch v3.2.x (Allow numbers to set uvc for all arrows in quiver.set_UVC, fixes #16743) +* :ghpull:`16763`: Backport PR #16648 on branch v3.2.x (Document filling of Poly3DCollection) +* :ghpull:`16764`: Backport PR #16672 on branch v3.2.0-doc +* :ghpull:`16765`: Backport PR #16736 on branch v3.2.x (xpdf: Set AutoRotatePages to None, not false.) +* :ghpull:`16766`: Backport PR #16734 on branch v3.2.x (Disable draw_foo methods on renderer used to estimate tight extents.) +* :ghpull:`16767`: Backport PR #15685 on branch v3.2.x (Avoid a RuntimeError at animation shutdown with PySide2.) +* :ghpull:`16768`: Backport PR #16725 on branch v3.2.x (TST/CI: also try to run test_user_fonts_win32 on azure) +* :ghpull:`16770`: Fix tuple markers +* :ghpull:`16779`: Documentation: make instructions for documentation contributions easier to find, add to requirements for building docs +* :ghpull:`16784`: Update CircleCI URL for downloading humor-sans.ttf. +* :ghpull:`16790`: Backport PR #16784 on branch v3.2.x (Update CircleCI URL for downloading humor-sans.ttf.) +* :ghpull:`16791`: Backport PR #16770 on branch v3.2.x (Fix tuple markers) +* :ghpull:`16794`: DOC: Don't mention drawstyle in ``set_linestyle`` docs. +* :ghpull:`16795`: Backport PR #15199 on branch v3.2.x (MNT/TST: generalize check_figures_equal to work with pytest.marks) +* :ghpull:`16797`: Backport #15589 and #16693, fixes for check_figures_equal +* :ghpull:`16799`: Backport PR #16794 on branch v3.2.0-doc (DOC: Don't mention drawstyle in ``set_linestyle`` docs.) +* :ghpull:`16800`: Fix check_figures_equal for tests that use its fixtures. +* :ghpull:`16803`: Fix some doc issues +* :ghpull:`16806`: Backport PR #16803 on branch v3.2.0-doc (Fix some doc issues) +* :ghpull:`16809`: Backport PR #16779 on branch v3.2.0-doc (Documentation: make instructions for documentation contributions easier to find, add to requirements for building docs) + +Issues (11): + +* :ghissue:`12820`: [Annotations] ValueError: lines do not intersect when computing tight bounding box containing arrow with filled paths +* :ghissue:`16538`: xpdf distiller seems broken +* :ghissue:`16624`: Azure pipelines are broken on v3.2.x +* :ghissue:`16633`: Wrong drawing Poly3DCollection +* :ghissue:`16645`: Minor typo in API document of patches.ConnectionPatch +* :ghissue:`16670`: BLD: ascii codec decode on 3.2.0 in non-UTF8 locales +* :ghissue:`16704`: 3.2.0: ``setup.py clean`` fails with ``NameError: name 'long_description' is not defined`` +* :ghissue:`16721`: nbAgg backend does not allow saving figures as png +* :ghissue:`16731`: PGF backend + savefig.bbox results in I/O error in 3.2 +* :ghissue:`16743`: Breaking change in 3.2: quiver.set_UVC does not support single numbers any more +* :ghissue:`16801`: Doc: figure for colormaps off diff --git a/doc/users/prev_whats_new/github_stats_3.2.2.rst b/doc/users/prev_whats_new/github_stats_3.2.2.rst new file mode 100644 index 000000000000..8cd4e4eef1d7 --- /dev/null +++ b/doc/users/prev_whats_new/github_stats_3.2.2.rst @@ -0,0 +1,167 @@ +.. _github-stats-3-2-2: + +GitHub Stats for Matplotlib 3.2.2 +================================= + +GitHub stats for 2020/03/18 - 2020/06/17 (tag: v3.2.1) + +These lists are automatically generated, and may be incomplete or contain duplicates. + +We closed 34 issues and merged 92 pull requests. +The full list can be seen `on GitHub `__ + +The following 19 authors contributed 183 commits. + +* Antony Lee +* Ben Root +* Clemens Brunner +* David Stansby +* Elliott Sales de Andrade +* Eric Firing +* Eric Wieser +* hannah +* Jody Klymak +* Lawrence D'Anna +* Leo Singer +* Luke Davis +* Matt Newville +* Max +* Ryan May +* Sidharth Bansal +* Stefan Mitic +* Thomas A Caswell +* Tim Hoffmann + +GitHub issues and pull requests: + +Pull Requests (92): + +* :ghpull:`17655`: Auto backport of pr 17564 on v3.2.x +* :ghpull:`17564`: FIX: correctly handle large arcs +* :ghpull:`17641`: Qt backports +* :ghpull:`17640`: More qt fractional DPI fixes +* :ghpull:`17638`: V3.2.1 doc +* :ghpull:`15656`: Support fractional HiDpi scaling with Qt backends +* :ghpull:`17600`: FIX: work with PyQt 5.15 +* :ghpull:`17598`: DOC: remove banner +* :ghpull:`17618`: Doc event loop +* :ghpull:`17614`: DOC: Remove duplicated line. +* :ghpull:`17611`: Backport #17606 to v3.2.x +* :ghpull:`17609`: Backport PR #17602: FIX: propagate _is_saving state when changing can… +* :ghpull:`17606`: Move codecov.yml to .github. +* :ghpull:`17602`: FIX: propagate _is_saving state when changing canvases +* :ghpull:`17605`: Backport PR #17560: FIX: do not let no-op monkey patches to renderer … +* :ghpull:`17601`: Backport PR #16948 on branch v3.2.x (solution: All subclasses of LocationEvent could be used in cbook.callbacks before being fully initialized - issue 15139) +* :ghpull:`17560`: FIX: do not let no-op monkey patches to renderer leak out +* :ghpull:`16948`: solution: All subclasses of LocationEvent could be used in cbook.callbacks before being fully initialized - issue 15139 +* :ghpull:`17588`: Backport PR #17565: FIX: support Qt 5.15 +* :ghpull:`17593`: Backport PR #17587 on branch v3.2.x (Add a docstring to toolkit's BezierPath.__init__.) +* :ghpull:`17587`: Add a docstring to toolkit's BezierPath.__init__. +* :ghpull:`17565`: FIX: support Qt 5.15 +* :ghpull:`17562`: Backport PR #17470 on branch v3.2.x (FIX: add guardrails for too big tk figures) +* :ghpull:`17470`: FIX: add guardrails for too big tk figures +* :ghpull:`17553`: Backport PR #17552 on branch v3.2.x (ci: Add xcb libraries that were removed from PyQt5.) +* :ghpull:`17552`: ci: Add xcb libraries that were removed from PyQt5. +* :ghpull:`17533`: Backport PR #17408 on branch v3.2.x +* :ghpull:`17408`: FIX: cancel pending autoscale on manually setting limits +* :ghpull:`17501`: Backport PR #17499: Fix scatter singlecolor +* :ghpull:`17499`: Fix scatter singlecolor +* :ghpull:`17468`: v3.2.x: Fix leaks in C++ code +* :ghpull:`17457`: Backport PR #17391 on branch v3.2.x +* :ghpull:`17391`: tk/wx: Fix saving after the window is closed +* :ghpull:`17435`: Backport PR #17422: Unstale viewlims before draw()ing polar axes. +* :ghpull:`17422`: Unstale viewlims before draw()ing polar axes. +* :ghpull:`17407`: FIX: don't try to use non-standard functions on standard status bars +* :ghpull:`17346`: Backport #17084 and #17210 to v3.2.x +* :ghpull:`17084`: Fix macosx segfault +* :ghpull:`17300`: Backport PR #17263 on branch v3.2.x (you can't call CGDataProviderCreateWithData on a stack pointer) +* :ghpull:`17263`: you can't call CGDataProviderCreateWithData on a stack pointer +* :ghpull:`17272`: Backport PR #17271 on branch v3.2.x (MNT: do not try to import xml.etree.cElementTree) +* :ghpull:`17271`: MNT: do not try to import xml.etree.cElementTree +* :ghpull:`17268`: Backport PR #17261 on branch v3.2.x (avoid calling wx.Bitmap() if width or height is zero) +* :ghpull:`17261`: avoid calling wx.Bitmap() if width or height is zero +* :ghpull:`17257`: Backport eps work +* :ghpull:`17255`: Fix eps + usetex combo. +* :ghpull:`17254`: Backport PR #17252 on branch v3.2.x (Fix bug where matplotlib.style('default') resets the backend) +* :ghpull:`17252`: Fix bug where matplotlib.style('default') resets the backend +* :ghpull:`17250`: Merge pull request #17206 from jklymak/fix-bypass-inverse-collection +* :ghpull:`17206`: FIX: bypass inverse in collection +* :ghpull:`17241`: Backport PR #17240 on branch v3.2.x (CI: Download wx wheels for the correct Ubuntu version.) +* :ghpull:`17240`: CI: Download wx wheels for the correct Ubuntu version. +* :ghpull:`17210`: Fix missing attribute in _SVGConverter. +* :ghpull:`17186`: Backport PR #17131 on branch v3.2.x +* :ghpull:`17188`: Backport PR #16958: MAINT: Replace uses of tostring with tobytes +* :ghpull:`17187`: Backport PR #17076: Fix SyntaxErrors when running setup in old Python +* :ghpull:`16913`: Fix use of psfrags in ps backend + usetex. +* :ghpull:`16476`: Fix baseline alignment when using usetex. +* :ghpull:`17131`: BUG: Fix formatting error in GridSpec.__repr__ +* :ghpull:`17132`: Backport PR #17126 on branch v3.2.x (Remove Python2/3 info box) +* :ghpull:`17126`: Remove Python2/3 info box +* :ghpull:`17076`: Fix SyntaxErrors when running setup in old Python +* :ghpull:`17071`: Backport PR #17065 on branch v3.2.x (Fix macOS CI test failure) +* :ghpull:`17065`: Fix macOS CI test failure +* :ghpull:`17051`: Backport PR #17045: Fix missing-references.json. +* :ghpull:`17045`: Fix missing-references.json. +* :ghpull:`17020`: Merge pull request #17017 from jklymak/fix-blended-transform +* :ghpull:`17017`: FIX: force blended transforms with data to be in data space +* :ghpull:`16989`: Backport PR #16980 on branch v3.2.x (Correctly disable more drawing methods in tight_bboxing renderer.) +* :ghpull:`16980`: Correctly disable more drawing methods in tight_bboxing renderer. +* :ghpull:`16974`: Backport PR #16940 on branch v3.2.x (DOC/FIX: clarify the docs for check_figures_equal) +* :ghpull:`16979`: Backport PR #16970 on branch v3.2.x (tk: Don't resize toolbar during resize event.) +* :ghpull:`16970`: tk: Don't resize toolbar during resize event. +* :ghpull:`16940`: DOC/FIX: clarify the docs for check_figures_equal +* :ghpull:`16969`: Backport PR #16966 on branch v3.2.x (Fix animation writer fallback.) +* :ghpull:`16966`: Fix animation writer fallback. +* :ghpull:`16958`: MAINT: Replace uses of tostring with tobytes +* :ghpull:`16950`: Backport PR #16949 on branch v3.2.x (TST: Don't modify actual pyplot file for boilerplate test.) +* :ghpull:`16949`: TST: Don't modify actual pyplot file for boilerplate test. +* :ghpull:`16932`: Backport PR #16929 on branch v3.2.x (tk: Resize the canvas, not the figure.) +* :ghpull:`16929`: tk: Resize the canvas, not the figure. +* :ghpull:`16880`: Backport PR #16870: Unbreak CI by xfailing wxAgg test on macOS +* :ghpull:`16870`: Unbreak CI by xfailing wxAgg test on macOS +* :ghpull:`16869`: Backport PR #16867 on branch v3.2.x (BLD: Auto-trigger macOS/Linux wheels on tags.) +* :ghpull:`16867`: BLD: Auto-trigger macOS/Linux wheels on tags. +* :ghpull:`16852`: Backport PR #16851 on branch v3.2.x (DOC: Fix docstring of Axes.secondary_yaxis.) +* :ghpull:`16855`: Fix typo in deprecation warning +* :ghpull:`16851`: DOC: Fix docstring of Axes.secondary_yaxis. +* :ghpull:`16842`: Backport PR #16835 on branch v3.2.x (Don't forget to export isdeleted on Qt4.) +* :ghpull:`16835`: Don't forget to export isdeleted on Qt4. +* :ghpull:`15695`: Define \mathdefault as a noop in the usetex preamble. +* :ghpull:`14694`: Vectorize Arc.draw. + +Issues (34): + +* :ghissue:`17547`: Arcs with large radii in small +* :ghissue:`17440`: Low quality window plots on hidpi display +* :ghissue:`17104`: input() caused _tkinter.TclError: invalid command name XXX after plot.close() +* :ghissue:`17613`: Matplotlib.pdf duplication +* :ghissue:`15139`: All subclasses of LocationEvent could be used in cbook.callbacks before being fully initialized +* :ghissue:`17004`: Output regression in 3.2 that affects SymPy's plotting +* :ghissue:`17599`: Saving issue with pdf backend +* :ghissue:`17542`: Matplotlib 3.2.1 savefig empty image when fig size matches data size exactly +* :ghissue:`17594`: Cannot use Qt4Agg backend in mpl 3.2.1 +* :ghissue:`17460`: set_size_inches with a width over 14090 crashes Xorg +* :ghissue:`17331`: Surprising/changed axis limit (autoscale) behavior +* :ghissue:`17423`: Scatter produce multiple colors for a single RGB/RGBA input +* :ghissue:`17385`: Matplotlib memory leaks when save figure in a file with qt5 backend +* :ghissue:`15474`: Memory leak with log scale in pcolorfast, pcolormesh, imshow ... +* :ghissue:`17388`: savefig error: tkinter.TclError: invalid command name "." +* :ghissue:`16909`: plot save and plot show +* :ghissue:`17085`: set_function not working properly in backend_wx +* :ghissue:`17418`: Issue rendering polar plot (agg backend?) with rorigin set +* :ghissue:`17061`: Segmentation fault with macosx backend +* :ghissue:`17253`: EPS + usetex is broken +* :ghissue:`16700`: Deprecation warnings from stylelib +* :ghissue:`17203`: Subplots using bad axis limits in 3.2 +* :ghissue:`16898`: EPS and ``usetex`` give blank output +* :ghissue:`16409`: Confusing error on fully commented-out usetex strings +* :ghissue:`17075`: Installation error downloading jquery on python3 on Ubuntu +* :ghissue:`17037`: Travis Failing in many PRs +* :ghissue:`17033`: Using a ``TextBox`` in current master produces a seemingly unrelated warning. +* :ghissue:`17016`: Issues with autoscaling and transforms with 3.2+ +* :ghissue:`16978`: savefig("myplot.svgz", bbox_inches="tight") fails +* :ghissue:`16965`: FuncAnimation.save throws TypeError +* :ghissue:`16916`: check_figures_equal regression from 3.2.0 to 3.2.1 +* :ghissue:`10566`: blocking UI functions cause figure size to change +* :ghissue:`10083`: Wrong figure height after set_size_inches within event handler +* :ghissue:`16834`: Error importing FigureCanvas diff --git a/doc/users/prev_whats_new/whats_new_1.0.rst b/doc/users/prev_whats_new/whats_new_1.0.rst index 4f0a6fc47039..cafa8917d518 100644 --- a/doc/users/prev_whats_new/whats_new_1.0.rst +++ b/doc/users/prev_whats_new/whats_new_1.0.rst @@ -1,7 +1,7 @@ .. _whats-new-1-0: New in matplotlib 1.0 -====================== +===================== .. contents:: Table of Contents :depth: 2 @@ -9,7 +9,7 @@ New in matplotlib 1.0 .. _whats-new-html5: HTML5/Canvas backend ---------------------- +-------------------- Simon Ratcliffe and Ludwig Schwardt have released an `HTML5/Canvas `__ backend for matplotlib. The @@ -47,7 +47,7 @@ indexing (starts with 0). e.g.:: See :doc:`/gallery/subplots_axes_and_figures/subplot_demo` for several code examples. Contour fixes and and triplot ---------------------------------- +----------------------------- Ian Thomas has fixed a long-standing bug that has vexed our most talented developers for years. :func:`~matplotlib.pyplot.contourf` @@ -66,7 +66,7 @@ plotting unstructured triangular grids. Triplot Demo multiple calls to show supported ---------------------------------- +-------------------------------- A long standing request is to support multiple calls to :func:`~matplotlib.pyplot.show`. This has been difficult because it @@ -85,7 +85,7 @@ and `bug tracker mplot3d graphs can be embedded in arbitrary axes -------------------------------------------------- +------------------------------------------------ You can now place an mplot3d graph into an arbitrary axes location, supporting mixing of 2D and 3D graphs in the same figure, and/or @@ -100,7 +100,7 @@ argument to add_axes or add_subplot. Thanks Ben Root. What's New 1 Subplot3d tick_params ------------- +----------- Eric Firing wrote tick_params, a convenience method for changing the appearance of ticks and tick labels. See pyplot function @@ -108,7 +108,7 @@ appearance of ticks and tick labels. See pyplot function :meth:`~matplotlib.axes.Axes.tick_params`. Lots of performance and feature enhancements ---------------------------------------------- +-------------------------------------------- * Faster magnification of large images, and the ability to zoom in to @@ -124,7 +124,7 @@ Lots of performance and feature enhancements throughout the API Much improved software carpentry ---------------------------------- +-------------------------------- The matplotlib trunk is probably in as good a shape as it has ever been, thanks to improved `software carpentry @@ -140,7 +140,7 @@ Thanks to Andrew Straw, Michael Droettboom and other matplotlib developers for the heavy lifting. Bugfix marathon ----------------- +--------------- Eric Firing went on a bug fixing and closing marathon, closing over 100 bugs on the (now-closed) SourceForge bug tracker with help from Jae-Joon Lee, Michael diff --git a/doc/users/prev_whats_new/whats_new_1.5.rst b/doc/users/prev_whats_new/whats_new_1.5.rst index 55f52aa5e417..97e4f81fd306 100644 --- a/doc/users/prev_whats_new/whats_new_1.5.rst +++ b/doc/users/prev_whats_new/whats_new_1.5.rst @@ -113,7 +113,7 @@ on two or more property cycles. New Colormaps --------------- +------------- All four of the colormaps proposed as the new default are available as ``'viridis'`` (the new default in 2.0), ``'magma'``, ``'plasma'``, and diff --git a/doc/users/prev_whats_new/whats_new_2.2.rst b/doc/users/prev_whats_new/whats_new_2.2.rst index 41f28ff72b17..05affccc7a6f 100644 --- a/doc/users/prev_whats_new/whats_new_2.2.rst +++ b/doc/users/prev_whats_new/whats_new_2.2.rst @@ -37,14 +37,14 @@ Features include: Note the new API to access this: New ``plt.figure`` and ``plt.subplots`` kwarg: ``constrained_layout`` -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :meth:`~matplotlib.pyplot.figure` and :meth:`~matplotlib.pyplot.subplots` can now be called with ``constrained_layout=True`` kwarg to enable constrained_layout. New ``ax.set_position`` behaviour -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ `.Axes.set_position` now makes the specified axis no longer responsive to ``constrained_layout``, consistent with the idea that the diff --git a/doc/users/prev_whats_new/whats_new_3.0.rst b/doc/users/prev_whats_new/whats_new_3.0.rst index 870f33bb0d5f..c92bc9c94f88 100644 --- a/doc/users/prev_whats_new/whats_new_3.0.rst +++ b/doc/users/prev_whats_new/whats_new_3.0.rst @@ -1,7 +1,7 @@ .. _whats-new-3-0-0: New in Matplotlib 3.0 -============================= +===================== Improved default backend selection ---------------------------------- @@ -10,8 +10,8 @@ The default backend no longer must be set as part of the build process. Instead, at run time, the builtin backends are tried in sequence until one of them imports. -Headless linux servers (identified by the DISPLAY env not being defined) -will not select a GUI backend. +Headless Linux servers (identified by the DISPLAY environment variable not +being defined) will not select a GUI backend. Cyclic colormaps ---------------- @@ -41,7 +41,7 @@ the order of magnitude depending on the axis values, rather than keeping it fixe Add ``AnchoredDirectionArrows`` feature to mpl_toolkits --------------------------------------------------------- +------------------------------------------------------- A new mpl_toolkits class :class:`~mpl_toolkits.axes_grid1.anchored_artists.AnchoredDirectionArrows` @@ -53,29 +53,28 @@ be rotated and the color can be changed. By default the labels and arrows have the same color, but the class may also pass arguments for customizing arrow and text layout, these are passed to :class:`matplotlib.textpath.TextPath` and `matplotlib.patches.FancyArrowPatch`. Location, length and width for both -arrow tail and head can be adjusted, the the direction arrows and labels can -have a frame. Padding and separation parameters can be adjusted. +arrow tail and head can be adjusted, the direction arrows and labels can have a +frame. Padding and separation parameters can be adjusted. Add ``minorticks_on()/off()`` methods for colorbar -------------------------------------------------- -A new method :meth:`.colorbar.Colobar.minorticks_on` has been added -to correctly display minor ticks on a colorbar. This method -doesn't allow the minor ticks to extend into the regions beyond vmin and vmax -when the *extend* kwarg (used while creating the colorbar) is set to 'both', -'max' or 'min'. -A complementary method :meth:`.colorbar.Colobar.minorticks_off` -has also been added to remove the minor ticks on the colorbar. +A new method :meth:`.colorbar.Colobar.minorticks_on` has been added to +correctly display minor ticks on a colorbar. This method doesn't allow the +minor ticks to extend into the regions beyond vmin and vmax when the *extend* +keyword argument (used while creating the colorbar) is set to 'both', 'max' or +'min'. A complementary method :meth:`.colorbar.Colobar.minorticks_off` has +also been added to remove the minor ticks on the colorbar. Colorbar ticks can now be automatic ----------------------------------- The number of ticks placed on colorbars was previously appropriate for a large -colorbar, but looked bad if the colorbar was made smaller (i.e. via the ``shrink`` kwarg). -This has been changed so that the number of ticks is now responsive to how -large the colorbar is. +colorbar, but looked bad if the colorbar was made smaller (i.e. via the +*shrink* keyword argument). This has been changed so that the number of ticks +is now responsive to how large the colorbar is. @@ -94,14 +93,14 @@ overwriting, especially when the figure name has been manually set using `.figure.Figure.canvas.set_window_title()`. -Legend now has a *title_fontsize* kwarg (and rcParam) ------------------------------------------------------ +Legend now has a *title_fontsize* keyword argument (and rcParam) +---------------------------------------------------------------- -The title for a `.Figure.legend` and `.Axes.legend` can now have its -fontsize set via the ``title_fontsize`` kwarg. There is also a new -:rc:`legend.title_fontsize`. Both default to ``None``, which means -the legend title will have the same fontsize as the axes default fontsize -(*not* the legend fontsize, set by the ``fontsize`` kwarg or +The title for a `.Figure.legend` and `.Axes.legend` can now have its font size +set via the *title_fontsize* keyword argument. There is also a new +:rc:`legend.title_fontsize`. Both default to ``None``, which means the legend +title will have the same font size as the axes default font size (*not* the +legend font size, set by the *fontsize* keyword argument or :rc:`legend.fontsize`). @@ -113,10 +112,10 @@ of the attribute `axes.prop_cycle` with cyclers using the `markevery` Line2D object property. An example of this feature is provided at :doc:`/gallery/lines_bars_and_markers/markevery_prop_cycle`. -Multipage PDF support for pgf backend -------------------------------------- +Multi-page PDF support for pgf backend +-------------------------------------- -The pgf backend now also supports multipage PDF files. +The pgf backend now also supports multi-page PDF files. .. code-block:: python @@ -228,4 +227,4 @@ Sphinx 1.8 provides by default. (``:mathmpl:`` uses Matplotlib to render math expressions to images embedded in html, whereas Sphinx uses MathJax.) When using Sphinx<1.8, both names (``:math:`` and ``:mathmpl:``) remain -available for backcompatibility. +available for backwards-compatibility. diff --git a/doc/users/prev_whats_new/whats_new_3.1.0.rst b/doc/users/prev_whats_new/whats_new_3.1.0.rst index 2c5f2fd45023..c55191af10c2 100644 --- a/doc/users/prev_whats_new/whats_new_3.1.0.rst +++ b/doc/users/prev_whats_new/whats_new_3.1.0.rst @@ -175,12 +175,11 @@ changed. `.ConnectionPatch` accepts arbitrary transforms ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -Alternatively to strings like ``"data"`` or ``"axes fraction"`` -`ConnectionPatch` now accepts any `~matplotlib.transforms.Transform` -as input for the ``coordsA`` and ``coordsB`` argument. This allows to -draw lines between points defined in different user defined coordinate -systems. Also see the :doc:`Connect Simple01 example -`. +Alternatively to strings like ``"data"`` or ``"axes fraction"``, +`ConnectionPatch` now accepts any `~matplotlib.transforms.Transform` as input +for the *coordsA* and *coordsB* arguments. This allows to draw lines between +points defined in different user defined coordinate systems. Also see the +:doc:`Connect Simple01 example `. mplot3d Line3D now allows {set,get}_data_3d @@ -244,11 +243,10 @@ The `.Axis.get_inverted` and `.Axis.set_inverted` methods query and set whether the axis uses "inverted" orientation (i.e. increasing to the left for the x-axis and to the bottom for the y-axis). -They perform tasks similar to `.Axes.xaxis_inverted`, -`.Axes.yaxis_inverted`, `.Axes.invert_xaxis`, and -`.Axes.invert_yaxis`, with the specific difference that -`.Axes..set_inverted` makes it easier to set the invertedness of an -axis regardless of whether it had previously been inverted before. +They perform tasks similar to `.Axes.xaxis_inverted`, `.Axes.yaxis_inverted`, +`.Axes.invert_xaxis`, and `.Axes.invert_yaxis`, with the specific difference +that `.Axis.set_inverted` makes it easier to set the inversion of an axis +regardless of whether it had previously been inverted before. Adjust default minor tick spacing ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -260,18 +258,17 @@ Default minor tick spacing was changed from 0.625 to 0.5 for major ticks spaced `.EngFormatter` now accepts *usetex*, *useMathText* as keyword only arguments ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -A public API has been added to `.EngFormatter` to control how the -numbers in the ticklabels will be rendered. By default, -``useMathText`` evaluates to -:rc:`axes.formatter.use_mathtext'` and ``usetex`` evaluates -to :rc:`'text.usetex'`. +A public API has been added to `.EngFormatter` to control how the numbers in +the ticklabels will be rendered. By default, *useMathText* evaluates to +:rc:`axes.formatter.use_mathtext'` and *usetex* evaluates to +:rc:`'text.usetex'`. If either is `True` then the numbers will be encapsulated by ``$`` signs. When using ``TeX`` this implies that the numbers will be shown in TeX's math font. When using mathtext, the ``$`` signs around -numbers will ensure unicode rendering (as implied by mathtext). This +numbers will ensure Unicode rendering (as implied by mathtext). This will make sure that the minus signs in the ticks are rendered as the -unicode=minus (U+2212) when using mathtext (without relying on the +Unicode minus (U+2212) when using mathtext (without relying on the `~.Formatter.fix_minus` method). @@ -311,9 +308,9 @@ caching; thereby, this new argument provides a fix for issue Endless Looping GIFs with PillowWriter ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -We acknowledge that most people want to watch a gif more than -once. Saving an animation as a gif with PillowWriter now produces an -endless looping gif. +We acknowledge that most people want to watch a GIF more than +once. Saving an animation as a GIF with PillowWriter now produces an +endless looping GIF. Adjusted `.matplotlib.widgets.Slider` to have vertical orientation diff --git a/doc/users/prev_whats_new/whats_new_3.2.0.rst b/doc/users/prev_whats_new/whats_new_3.2.0.rst index 53f66778a735..0e6c9a867898 100644 --- a/doc/users/prev_whats_new/whats_new_3.2.0.rst +++ b/doc/users/prev_whats_new/whats_new_3.2.0.rst @@ -89,9 +89,9 @@ parameter. Shifting errorbars ------------------ -Previously, `~.Axes.errorbar()` accepted a kwarg *errorevery* such that the -command ``plt.errorbar(x, y, yerr, errorevery=6)`` would add error bars to -datapoints ``x[::6], y[::6]``. +Previously, `~.Axes.errorbar()` accepted a keyword argument *errorevery* such +that the command ``plt.errorbar(x, y, yerr, errorevery=6)`` would add error +bars to datapoints ``x[::6], y[::6]``. `~.Axes.errorbar()` now also accepts a tuple for *errorevery* such that ``plt.errorbar(x, y, yerr, errorevery=(start, N))`` adds error bars to points @@ -124,3 +124,10 @@ will fall back to previous behaviour, which is using the color in ``text.color`` Colors can now be specified using 3-digit or 4-digit hex colors, shorthand for the colors obtained by duplicating each character, e.g. ``#123`` is equivalent to ``#112233`` and ``#123a`` is equivalent to ``#112233aa``. + + + +Added support for RGB(A) images in pcolorfast +--------------------------------------------- + +`.Axes.pcolorfast` now accepts 3D images (RGB or RGBA) arrays. diff --git a/doc/users/prev_whats_new/whats_new_3.3.0.rst b/doc/users/prev_whats_new/whats_new_3.3.0.rst new file mode 100644 index 000000000000..b4008f111d64 --- /dev/null +++ b/doc/users/prev_whats_new/whats_new_3.3.0.rst @@ -0,0 +1,713 @@ +============================== +What's new in Matplotlib 3.3.0 +============================== + +For a list of all of the issues and pull requests since the last +revision, see the :ref:`github-stats`. + +.. contents:: Table of Contents + :depth: 4 + +.. toctree:: + :maxdepth: 4 + + +Figure and Axes creation / management +===================================== + +Provisional API for composing semantic axes layouts from text or nested lists +----------------------------------------------------------------------------- + +The `.Figure` class has a provisional method to generate complex grids of named +`.axes.Axes` based on nested list input or ASCII art: + +.. plot:: + :include-source: True + + axd = plt.figure(constrained_layout=True).subplot_mosaic( + [['.', 'histx'], + ['histy', 'scat']] + ) + for k, ax in axd.items(): + ax.text(0.5, 0.5, k, + ha='center', va='center', fontsize=36, + color='darkgrey') + +or as a string (with single-character Axes labels): + +.. plot:: + :include-source: True + + axd = plt.figure(constrained_layout=True).subplot_mosaic( + """ + TTE + L.E + """) + for k, ax in axd.items(): + ax.text(0.5, 0.5, k, + ha='center', va='center', fontsize=36, + color='darkgrey') + +See :ref:`sphx_glr_tutorials_provisional_mosaic.py` for more +details and examples. + +``GridSpec.subplots()`` +----------------------- + +The `.GridSpec` class gained a `~.GridSpecBase.subplots` method, so that one +can write :: + + fig.add_gridspec(2, 2, height_ratios=[3, 1]).subplots() + +as an alternative to :: + + fig.subplots(2, 2, gridspec_kw={"height_ratios": [3, 1]}) + +New ``Axes.sharex``, ``Axes.sharey`` methods +-------------------------------------------- + +These new methods allow sharing axes *immediately* after creating them. Note +that behavior is indeterminate if axes are not shared immediately after +creation. + +For example, they can be used to selectively link some axes created all +together using `~.Figure.subplot_mosaic`:: + + fig = plt.figure(constrained_layout=True) + axd = fig.subplot_mosaic([['.', 'histx'], ['histy', 'scat']], + gridspec_kw={'width_ratios': [1, 7], + 'height_ratios': [2, 7]}) + + axd['histx'].sharex(axd['scat']) + axd['histy'].sharey(axd['scat']) + +.. plot:: + + np.random.seed(0) + x = np.random.random(100) * 100 + 20 + y = np.random.random(100) * 50 + 25 + c = np.random.random(100) - 0.5 + + fig = plt.figure(constrained_layout=True) + axd = fig.subplot_mosaic([['.', 'histx'], ['histy', 'scat']], + gridspec_kw={'width_ratios': [1, 7], + 'height_ratios': [2, 7]}) + + axd['histy'].invert_xaxis() + axd['histx'].sharex(axd['scat']) + axd['histy'].sharey(axd['scat']) + + im = axd['scat'].scatter(x, y, c=c, cmap='RdBu', picker=True) + fig.colorbar(im, orientation='horizontal', ax=axd['scat'], shrink=0.8) + + axd['histx'].hist(x) + axd['histy'].hist(y, orientation='horizontal') + +tight_layout now supports suptitle +---------------------------------- + +Previous versions did not consider `.Figure.suptitle`, so it may overlap with +other artists after calling `~.Figure.tight_layout`: + +.. plot:: + + fig, axs = plt.subplots(1, 3) + for i, ax in enumerate(axs): + ax.plot([1, 2, 3]) + ax.set_title(f'Axes {i}') + + t = fig.suptitle('suptitle') + t.set_in_layout(False) + fig.tight_layout() + +From now on, the ``suptitle`` will be considered: + +.. plot:: + + fig, axs = plt.subplots(1, 3) + for i, ax in enumerate(axs): + ax.plot([1, 2, 3]) + ax.set_title(f'Axes {i}') + + fig.suptitle('suptitle') + fig.tight_layout() + +Setting axes box aspect +----------------------- + +It is now possible to set the aspect of an axes box directly via +`~.Axes.set_box_aspect`. The box aspect is the ratio between axes height and +axes width in physical units, independent of the data limits. This is useful +to, e.g., produce a square plot, independent of the data it contains, or to +have a non-image plot with the same axes dimensions next to an image plot with +fixed (data-)aspect. + +For use cases check out the :doc:`Axes box aspect +` example. + + +Colors and colormaps +==================== + +Turbo colormap +-------------- + +Turbo is an improved rainbow colormap for visualization, created by the Google +AI team for computer vision and machine learning. Its purpose is to +display depth and disparity data. Please see the `Google AI Blog +`_ +for further details. + +.. plot:: + + gradient = np.linspace(0, 1, 256) + gradient = np.vstack((gradient, gradient)) + cmaps = ['turbo', 'jet', 'gist_rainbow_r', 'hsv_r'] + + fig, axs = plt.subplots(len(cmaps), constrained_layout=True) + for name, ax in zip(cmaps, axs): + ax.imshow(gradient, aspect='auto', cmap=plt.get_cmap(name)) + ax.set_title(name) + ax.set_axis_off() + +``colors.BoundaryNorm`` supports *extend* keyword argument +---------------------------------------------------------- + +`~.colors.BoundaryNorm` now has an *extend* keyword argument, analogous to +*extend* in `~.axes.Axes.contourf`. When set to 'both', 'min', or 'max', it +maps the corresponding out-of-range values to `~.colors.Colormap` lookup-table +indices near the appropriate ends of their range so that the colors for out-of +range values are adjacent to, but distinct from, their in-range neighbors. The +colorbar inherits the *extend* argument from the norm, so with +``extend='both'``, for example, the colorbar will have triangular extensions +for out-of-range values with colors that differ from adjacent in-range colors. + + .. plot:: + + import matplotlib.pyplot as plt + from matplotlib.colors import BoundaryNorm + import numpy as np + + # Make the data + dx, dy = 0.05, 0.05 + y, x = np.mgrid[slice(1, 5 + dy, dy), + slice(1, 5 + dx, dx)] + z = np.sin(x) ** 10 + np.cos(10 + y * x) * np.cos(x) + z = z[:-1, :-1] + + # Z roughly varies between -1 and +1. + # Color boundary levels range from -0.8 to 0.8, so there are out-of-bounds + # areas. + levels = [-0.8, -0.5, -0.2, 0.2, 0.5, 0.8] + cmap = plt.get_cmap('PiYG') + + fig, axs = plt.subplots(nrows=2, constrained_layout=True, sharex=True) + + # Before this change: + norm = BoundaryNorm(levels, ncolors=cmap.N) + im = axs[0].pcolormesh(x, y, z, cmap=cmap, norm=norm) + fig.colorbar(im, ax=axs[0], extend='both') + axs[0].axis([x.min(), x.max(), y.min(), y.max()]) + axs[0].set_title("Colorbar with extend='both'") + + # With the new keyword: + norm = BoundaryNorm(levels, ncolors=cmap.N, extend='both') + im = axs[1].pcolormesh(x, y, z, cmap=cmap, norm=norm) + fig.colorbar(im, ax=axs[1]) # note that the colorbar is updated accordingly + axs[1].axis([x.min(), x.max(), y.min(), y.max()]) + axs[1].set_title("BoundaryNorm with extend='both'") + + plt.show() + +Text color for legend labels +---------------------------- + +The text color of legend labels can now be set by passing a parameter +``labelcolor`` to `~.axes.Axes.legend`. The ``labelcolor`` keyword can be: + +* A single color (either a string or RGBA tuple), which adjusts the text color + of all the labels. +* A list or tuple, allowing the text color of each label to be set + individually. +* ``linecolor``, which sets the text color of each label to match the + corresponding line color. +* ``markerfacecolor``, which sets the text color of each label to match the + corresponding marker face color. +* ``markeredgecolor``, which sets the text color of each label to match the + corresponding marker edge color. + +.. plot:: + + options = ['C3', 'linecolor', 'markerfacecolor', 'markeredgecolor'] + + fig, axs = plt.subplots(2, 2, constrained_layout=True) + for ax, color in zip(axs.flat, options): + ax.plot([1, 2, 3], marker='o', + color='C0', markerfacecolor='C1', markeredgecolor='C2', + linewidth=3, markersize=10, markeredgewidth=3, + label='a line') + + ax.legend(labelcolor=color) + ax.set_title(f'labelcolor={color!r}') + + ax.margins(0.1) + +Pcolor and Pcolormesh now accept ``shading='nearest'`` and ``'auto'`` +--------------------------------------------------------------------- + +Previously `.axes.Axes.pcolor` and `.axes.Axes.pcolormesh` handled the +situation where *x* and *y* have the same (respective) size as *C* by dropping +the last row and column of *C*, and *x* and *y* are regarded as the edges of +the remaining rows and columns in *C*. However, many users want *x* and *y* +centered on the rows and columns of *C*. + +To accommodate this, ``shading='nearest'`` and ``shading='auto'`` are new +allowed strings for the *shading* keyword argument. ``'nearest'`` will center +the color on *x* and *y* if *x* and *y* have the same dimensions as *C* +(otherwise an error will be thrown). ``shading='auto'`` will choose 'flat' or +'nearest' based on the size of *X*, *Y*, *C*. + +If ``shading='flat'`` then *X*, and *Y* should have dimensions one larger than +*C*. If *X* and *Y* have the same dimensions as *C*, then the previous behavior +is used and the last row and column of *C* are dropped, and a +DeprecationWarning is emitted. + +Users can also specify this by the new :rc:`pcolor.shading` in their +``.matplotlibrc`` or via `.rcParams`. + +See :doc:`pcolormesh ` +for examples. + + +Titles, ticks, and labels +========================= + +Align labels to Axes edges +-------------------------- + +`~.axes.Axes.set_xlabel`, `~.axes.Axes.set_ylabel` and +`.ColorbarBase.set_label` support a parameter ``loc`` for simplified +positioning. For the xlabel, the supported values are 'left', 'center', or +'right'. For the ylabel, the supported values are 'bottom', 'center', or +'top'. + +The default is controlled via :rc:`xaxis.labelposition` and +:rc:`yaxis.labelposition`; the Colorbar label takes the rcParam based on its +orientation. + +.. plot:: + + options = ['left', 'center', 'right'] + fig, axs = plt.subplots(len(options), 1, constrained_layout=True) + for ax, loc in zip(axs, options): + ax.plot([1, 2, 3]) + ax.set_xlabel(f'xlabel loc={loc!r}', loc=loc) + + options = ['bottom', 'center', 'top'] + fig, axs = plt.subplots(1, len(options), constrained_layout=True) + for ax, loc in zip(axs, options): + ax.plot([1, 2, 3]) + ax.set_ylabel(f'ylabel loc={loc!r}', loc=loc) + +Allow tick formatters to be set with str or function inputs +----------------------------------------------------------- + +`~.Axis.set_major_formatter` and `~.Axis.set_minor_formatter` +now accept `str` or function inputs in addition to `~.ticker.Formatter` +instances. For a `str` a `~.ticker.StrMethodFormatter` is automatically +generated and used. For a function a `~.ticker.FuncFormatter` is automatically +generated and used. In other words, +:: + + ax.xaxis.set_major_formatter('{x} km') + ax.xaxis.set_minor_formatter(lambda x, pos: str(x-5)) + +are shortcuts for:: + + import matplotlib.ticker as mticker + + ax.xaxis.set_major_formatter(mticker.StrMethodFormatter('{x} km')) + ax.xaxis.set_minor_formatter( + mticker.FuncFormatter(lambda x, pos: str(x-5)) + +.. plot:: + + from matplotlib import ticker + + titles = ["'{x} km'", "lambda x, pos: str(x-5)"] + formatters = ['{x} km', lambda x, pos: str(x-5)] + + fig, axs = plt.subplots(2, 1, figsize=(8, 2), constrained_layout=True) + + for ax, title, formatter in zip(axs, titles, formatters): + # only show the bottom spine + ax.yaxis.set_major_locator(ticker.NullLocator()) + for spine in ['top', 'left', 'right']: + ax.spines[spine].set_visible(False) + + # define tick positions + ax.xaxis.set_major_locator(ticker.MultipleLocator(1.00)) + ax.xaxis.set_minor_locator(ticker.MultipleLocator(0.25)) + + ax.tick_params(which='major', width=1.00, length=5) + ax.tick_params(which='minor', width=0.75, length=2.5, labelsize=10) + ax.set_xlim(0, 5) + ax.set_ylim(0, 1) + ax.text(0.0, 0.2, f'ax.xaxis.set_major_formatter({title})', + transform=ax.transAxes, fontsize=14, fontname='Monospace', + color='tab:blue') + + ax.xaxis.set_major_formatter(formatter) + +``Axes.set_title`` gains a *y* keyword argument to control auto positioning +--------------------------------------------------------------------------- + +`~.axes.Axes.set_title` tries to auto-position the title to avoid any +decorators on the top x-axis. This is not always desirable so now *y* is an +explicit keyword argument of `~.axes.Axes.set_title`. It defaults to *None* +which means to use auto-positioning. If a value is supplied (i.e. the pre-3.0 +default was ``y=1.0``) then auto-positioning is turned off. This can also be +set with the new rcParameter :rc:`axes.titley`. + +.. plot:: + + fig, axs = plt.subplots(1, 2, constrained_layout=True, figsize=(5, 2)) + axs[0].set_title('y=0.7\n$\sum_{j_n} x_j$', y=0.7) + axs[1].set_title('y=None\n$\sum_{j_n} x_j$') + plt.show() + +Offset text is now set to the top when using ``axis.tick_top()`` +---------------------------------------------------------------- + +Solves the issue that the power indicator (e.g., 1e4) stayed on the bottom, +even if the ticks were on the top. + +Set zorder of contour labels +---------------------------- + +`~.axes.Axes.clabel` now accepts a *zorder* keyword argument making it easier +to set the *zorder* of contour labels. If not specified, the default *zorder* +of clabels used to always be 3 (i.e. the default *zorder* of `~.text.Text`) +irrespective of the *zorder* passed to +`~.axes.Axes.contour`/`~.axes.Axes.contourf`. The new default *zorder* for +clabels has been changed to (``2 + zorder`` passed to `~.axes.Axes.contour` / +`~.axes.Axes.contourf`). + + +Other changes +============= + +New ``Axes.axline`` method +-------------------------- + +A new `~.axes.Axes.axline` method has been added to draw infinitely long lines +that pass through two points. + +.. plot:: + :include-source: True + + fig, ax = plt.subplots() + + ax.axline((.1, .1), slope=5, color='C0', label='by slope') + ax.axline((.1, .2), (.8, .7), color='C3', label='by points') + + ax.legend() + +``imshow`` now coerces 3D arrays with depth 1 to 2D +--------------------------------------------------- + +Starting from this version arrays of size MxNx1 will be coerced into MxN +for displaying. This means commands like ``plt.imshow(np.random.rand(3, 3, 1))`` +will no longer return an error message that the image shape is invalid. + +Better control of ``Axes.pie`` normalization +-------------------------------------------- + +Previously, `.Axes.pie` would normalize its input *x* if ``sum(x) > 1``, but +would do nothing if the sum were less than 1. This can be confusing, so an +explicit keyword argument *normalize* has been added. By default, the old +behavior is preserved. + +By passing *normalize*, one can explicitly control whether any rescaling takes +place or whether partial pies should be created. If normalization is disabled, +and ``sum(x) > 1``, then an error is raised. + +.. plot:: + + def label(x): + return [str(v) for v in x] + + x = np.array([0.25, 0.3, 0.3]) + fig, ax = plt.subplots(2, 2, constrained_layout=True) + + ax[0, 0].pie(x, autopct='%1.1f%%', labels=label(x), normalize=False) + ax[0, 0].set_title('normalize=False') + ax[0, 1].pie(x, autopct='%1.2f%%', labels=label(x), normalize=True) + ax[0, 1].set_title('normalize=True') + + # This is supposed to show the 'old' behavior of not passing *normalize* + # explicitly, but for the purposes of keeping the documentation build + # warning-free, and future proof for when the deprecation is made + # permanent, we pass *normalize* here explicitly anyway. + ax[1, 0].pie(x, autopct='%1.2f%%', labels=label(x), normalize=False) + ax[1, 0].set_title('normalize unspecified\nsum(x) < 1') + ax[1, 1].pie(x * 10, autopct='%1.2f%%', labels=label(x * 10), + normalize=True) + ax[1, 1].set_title('normalize unspecified\nsum(x) > 1') + +Dates use a modern epoch +------------------------ + +Matplotlib converts dates to days since an epoch using `.dates.date2num` (via +`matplotlib.units`). Previously, an epoch of ``0000-12-31T00:00:00`` was used +so that ``0001-01-01`` was converted to 1.0. An epoch so distant in the past +meant that a modern date was not able to preserve microseconds because 2000 +years times the 2^(-52) resolution of a 64-bit float gives 14 microseconds. + +Here we change the default epoch to the more reasonable UNIX default of +``1970-01-01T00:00:00`` which for a modern date has 0.35 microsecond +resolution. (Finer resolution is not possible because we rely on +`datetime.datetime` for the date locators). Access to the epoch is provided by +`~.dates.get_epoch`, and there is a new :rc:`date.epoch` rcParam. The user may +also call `~.dates.set_epoch`, but it must be set *before* any date conversion +or plotting is used. + +If you have data stored as ordinal floats in the old epoch, you can convert +them to the new ordinal using the following formula:: + + new_ordinal = old_ordinal + mdates.date2num(np.datetime64('0000-12-31')) + +Lines now accept ``MarkerStyle`` instances as input +--------------------------------------------------- + +Similar to `~.Axes.scatter`, `~.Axes.plot` and `~.lines.Line2D` now accept +`~.markers.MarkerStyle` instances as input for the *marker* parameter:: + + plt.plot(..., marker=matplotlib.markers.MarkerStyle("D")) + + +Fonts +===== + +Simple syntax to select fonts by absolute path +---------------------------------------------- + +Fonts can now be selected by passing an absolute `pathlib.Path` to the *font* +keyword argument of `.Text`. + +Improved font weight detection +------------------------------ + +Matplotlib is now better able to determine the weight of fonts from their +metadata, allowing to differentiate between fonts within the same family more +accurately. + + +rcParams improvements +===================== + +``matplotlib.rc_context`` can be used as a decorator +---------------------------------------------------- + +`matplotlib.rc_context` can now be used as a decorator (technically, it is now +implemented as a `contextlib.contextmanager`), e.g., :: + + @rc_context({"lines.linewidth": 2}) + def some_function(...): + ... + +rcParams for controlling default "raise window" behavior +-------------------------------------------------------- + +The new config option :rc:`figure.raise_window` allows disabling of the raising +of the plot window when calling `~.pyplot.show` or `~.pyplot.pause`. The +``MacOSX`` backend is currently not supported. + +Add generalized ``mathtext.fallback`` to rcParams +------------------------------------------------- + +New :rc:`mathtext.fallback` rcParam. Takes "cm", "stix", "stixsans" +or "none" to turn fallback off. The rcParam *mathtext.fallback_to_cm* is +deprecated, but if used, will override new fallback. + +Add ``contour.linewidth`` to rcParams +------------------------------------- + +The new config option :rc:`contour.linewidth` allows to control the default +line width of contours as a float. When set to ``None``, the line widths fall +back to :rc:`lines.linewidth`. The config value is overridden as usual by the +*linewidths* argument passed to `~.axes.Axes.contour` when it is not set to +``None``. + + +3D Axes improvements +==================== + +``Axes3D`` no longer distorts the 3D plot to match the 2D aspect ratio +---------------------------------------------------------------------- + +Plots made with :class:`~mpl_toolkits.mplot3d.axes3d.Axes3D` were previously +stretched to fit a square bounding box. As this stretching was done after the +projection from 3D to 2D, it resulted in distorted images if non-square +bounding boxes were used. As of 3.3, this no longer occurs. + +Currently, modes of setting the aspect (via +`~mpl_toolkits.mplot3d.axes3d.Axes3D.set_aspect`) in data space are not +supported for Axes3D but may be in the future. If you want to simulate having +equal aspect in data space, set the ratio of your data limits to match the +value of `~.get_box_aspect`. To control these ratios use the +`~mpl_toolkits.mplot3d.axes3d.Axes3D.set_box_aspect` method which accepts the +ratios as a 3-tuple of X:Y:Z. The default aspect ratio is 4:4:3. + +3D axes now support minor ticks +------------------------------- + +.. plot:: + :include-source: True + + ax = plt.figure().add_subplot(projection='3d') + + ax.scatter([0, 1, 2], [1, 3, 5], [30, 50, 70]) + + ax.set_xticks([0.25, 0.75, 1.25, 1.75], minor=True) + ax.set_xticklabels(['a', 'b', 'c', 'd'], minor=True) + + ax.set_yticks([1.5, 2.5, 3.5, 4.5], minor=True) + ax.set_yticklabels(['A', 'B', 'C', 'D'], minor=True) + + ax.set_zticks([35, 45, 55, 65], minor=True) + ax.set_zticklabels([r'$\alpha$', r'$\beta$', r'$\delta$', r'$\gamma$'], + minor=True) + + ax.tick_params(which='major', color='C0', labelcolor='C0', width=5) + ax.tick_params(which='minor', color='C1', labelcolor='C1', width=3) + +Home/Forward/Backward buttons now work with 3D axes +--------------------------------------------------- + + +Interactive tool improvements +============================= + +More consistent toolbar behavior across backends +------------------------------------------------ + +Toolbar features are now more consistent across backends. The history buttons +will auto-disable when there is no further action in a direction. The pan and +zoom buttons will be marked active when they are in use. + +In NbAgg and WebAgg, the toolbar buttons are now grouped similarly to other +backends. The WebAgg toolbar now uses the same icons as other backends. + +Toolbar icons are now styled for dark themes +-------------------------------------------- + +On dark themes, toolbar icons will now be inverted. When using the GTK3Agg +backend, toolbar icons are now symbolic, and both foreground and background +colors will follow the theme. Tooltips should also behave correctly. + +Cursor text now uses a number of significant digits matching pointing precision +------------------------------------------------------------------------------- + +Previously, the x/y position displayed by the cursor text would usually include +far more significant digits than the mouse pointing precision (typically one +pixel). This is now fixed for linear scales. + +GTK / Qt zoom rectangle now black and white +------------------------------------------- + +This makes it visible even over a dark background. + +Event handler simplifications +----------------------------- + +The `.backend_bases.key_press_handler` and +`.backend_bases.button_press_handler` event handlers can now be directly +connected to a canvas with ``canvas.mpl_connect("key_press_event", +key_press_handler)`` and ``canvas.mpl_connect("button_press_event", +button_press_handler)``, rather than having to write wrapper functions that +fill in the (now optional) *canvas* and *toolbar* parameters. + + +Functions to compute a Path's size +================================== + +Various functions were added to `~.bezier.BezierSegment` and `~.path.Path` to +allow computation of the shape/size of a `~.path.Path` and its composite Bezier +curves. + +In addition to the fixes below, `~.bezier.BezierSegment` has gained more +documentation and usability improvements, including properties that contain its +dimension, degree, control_points, and more. + +Better interface for Path segment iteration +------------------------------------------- + +`~.path.Path.iter_bezier` iterates through the `~.bezier.BezierSegment`'s that +make up the Path. This is much more useful typically than the existing +`~.path.Path.iter_segments` function, which returns the absolute minimum amount +of information possible to reconstruct the Path. + +Fixed bug that computed a Path's Bbox incorrectly +------------------------------------------------- + +Historically, `~.path.Path.get_extents` has always simply returned the Bbox of +a curve's control points, instead of the Bbox of the curve itself. While this is +a correct upper bound for the path's extents, it can differ dramatically from +the Path's actual extents for non-linear Bezier curves. + + +Backend-specific improvements +============================= + +``savefig()`` gained a *backend* keyword argument +------------------------------------------------- + +The *backend* keyword argument to ``savefig`` can now be used to pick the +rendering backend without having to globally set the backend; e.g., one can +save PDFs using the pgf backend with ``savefig("file.pdf", backend="pgf")``. + +The SVG backend can now render hatches with transparency +-------------------------------------------------------- + +The SVG backend now respects the hatch stroke alpha. Useful applications are, +among others, semi-transparent hatches as a subtle way to differentiate columns +in bar plots. + +SVG supports URLs on more artists +--------------------------------- + +URLs on more artists (i.e., from `.Artist.set_url`) will now be saved in +SVG files, namely, ``Tick``\s and ``Line2D``\s are now supported. + +Images in SVG will no longer be blurred in some viewers +------------------------------------------------------- + +A style is now supplied to images without interpolation (``imshow(..., +interpolation='none'``) so that SVG image viewers will no longer perform +interpolation when rendering themselves. + +Saving SVG now supports adding metadata +--------------------------------------- + +When saving SVG files, metadata can now be passed which will be saved in the +file using `Dublin Core`_ and `RDF`_. A list of valid metadata can be found in +the documentation for `.FigureCanvasSVG.print_svg`. + +.. _Dublin Core: https://www.dublincore.org/specifications/dublin-core/ +.. _RDF: https://www.w3.org/1999/.status/PR-rdf-syntax-19990105/status + +Saving PDF metadata via PGF now consistent with PDF backend +----------------------------------------------------------- + +When saving PDF files using the PGF backend, passed metadata will be +interpreted in the same way as with the PDF backend. Previously, this metadata +was only accepted by the PGF backend when saving a multi-page PDF with +`.backend_pgf.PdfPages`, but is now allowed when saving a single figure, as +well. + +NbAgg and WebAgg no longer use jQuery & jQuery UI +------------------------------------------------- + +Instead, they are implemented using vanilla JavaScript. Please report any +issues with browsers. diff --git a/doc/users/whats_new.rst b/doc/users/whats_new.rst index 58bb464e21d8..4131fccde0ba 100644 --- a/doc/users/whats_new.rst +++ b/doc/users/whats_new.rst @@ -1,8 +1,8 @@ .. _whats-new: -========== -What's New -========== +=========== +What's new? +=========== .. ifconfig:: releaselevel == 'dev' @@ -25,4 +25,5 @@ What's New next_whats_new/* -.. include:: prev_whats_new/whats_new_3.2.0.rst +.. Be sure to update the version in `exclude_patterns` in conf.py. +.. include:: prev_whats_new/whats_new_3.3.0.rst diff --git a/examples/animation/pause_resume.py b/examples/animation/pause_resume.py new file mode 100644 index 000000000000..ed20197f6167 --- /dev/null +++ b/examples/animation/pause_resume.py @@ -0,0 +1,47 @@ +""" +================================= +Pausing and Resuming an Animation +================================= + +This example showcases: +- using the Animation.pause() method to pause an animation. +- using the Animation.resume() method to resume an animation. +""" + +import matplotlib.pyplot as plt +import matplotlib.animation as animation +import numpy as np + + +class PauseAnimation: + def __init__(self): + fig, ax = plt.subplots() + ax.set_title('Click to pause/resume the animation') + x = np.linspace(-0.1, 0.1, 1000) + + # Start with a normal distribution + self.n0 = (1.0 / ((4 * np.pi * 2e-4 * 0.1) ** 0.5) + * np.exp(-x ** 2 / (4 * 2e-4 * 0.1))) + self.p, = ax.plot(x, self.n0) + + self.animation = animation.FuncAnimation( + fig, self.update, frames=200, interval=50, blit=True) + self.paused = False + + fig.canvas.mpl_connect('button_press_event', self.toggle_pause) + + def toggle_pause(self, *args, **kwargs): + if self.paused: + self.animation.resume() + else: + self.animation.pause() + self.paused = not self.paused + + def update(self, i): + self.n0 += i / 100 % 5 + self.p.set_ydata(self.n0 % 20) + return (self.p,) + + +pa = PauseAnimation() +plt.show() diff --git a/examples/axes_grid1/inset_locator_demo.py b/examples/axes_grid1/inset_locator_demo.py index 5fd0bc926794..56b5a8357e10 100644 --- a/examples/axes_grid1/inset_locator_demo.py +++ b/examples/axes_grid1/inset_locator_demo.py @@ -44,7 +44,7 @@ ############################################################################### -# The arguments *bbox_to_anchor* and *bbox_transfrom* can be used for a more +# The parameters *bbox_to_anchor* and *bbox_transform* can be used for a more # fine grained control over the inset position and size or even to position # the inset at completely arbitrary positions. # The *bbox_to_anchor* sets the bounding box in coordinates according to the diff --git a/examples/axisartist/axis_direction_demo_step01.py b/examples/axisartist/axis_direction_demo_step01.py index df5d8e57017c..daf4508baa45 100644 --- a/examples/axisartist/axis_direction_demo_step01.py +++ b/examples/axisartist/axis_direction_demo_step01.py @@ -25,7 +25,7 @@ def setup_axes(fig, rect): fig = plt.figure(figsize=(3, 2.5)) fig.subplots_adjust(top=0.8) -ax1 = setup_axes(fig, "111") +ax1 = setup_axes(fig, 111) ax1.axis["x"].set_axis_direction("left") diff --git a/examples/axisartist/axis_direction_demo_step02.py b/examples/axisartist/axis_direction_demo_step02.py index de6a21df4283..bc8a8e652b03 100644 --- a/examples/axisartist/axis_direction_demo_step02.py +++ b/examples/axisartist/axis_direction_demo_step02.py @@ -28,13 +28,13 @@ def setup_axes(fig, rect): fig = plt.figure(figsize=(6, 2.5)) fig.subplots_adjust(bottom=0.2, top=0.8) -ax1 = setup_axes(fig, "121") +ax1 = setup_axes(fig, 121) ax1.axis["x"].set_ticklabel_direction("+") ax1.annotate("ticklabel direction=$+$", (0.5, 0), xycoords="axes fraction", xytext=(0, -10), textcoords="offset points", va="top", ha="center") -ax2 = setup_axes(fig, "122") +ax2 = setup_axes(fig, 122) ax2.axis["x"].set_ticklabel_direction("-") ax2.annotate("ticklabel direction=$-$", (0.5, 0), xycoords="axes fraction", xytext=(0, -10), textcoords="offset points", diff --git a/examples/axisartist/axis_direction_demo_step03.py b/examples/axisartist/axis_direction_demo_step03.py index 6b6d6a287462..b02962af8ebf 100644 --- a/examples/axisartist/axis_direction_demo_step03.py +++ b/examples/axisartist/axis_direction_demo_step03.py @@ -28,7 +28,7 @@ def setup_axes(fig, rect): fig = plt.figure(figsize=(6, 2.5)) fig.subplots_adjust(bottom=0.2, top=0.8) -ax1 = setup_axes(fig, "121") +ax1 = setup_axes(fig, 121) ax1.axis["x"].label.set_text("Label") ax1.axis["x"].toggle(ticklabels=False) ax1.axis["x"].set_axislabel_direction("+") @@ -36,7 +36,7 @@ def setup_axes(fig, rect): xytext=(0, -10), textcoords="offset points", va="top", ha="center") -ax2 = setup_axes(fig, "122") +ax2 = setup_axes(fig, 122) ax2.axis["x"].label.set_text("Label") ax2.axis["x"].toggle(ticklabels=False) ax2.axis["x"].set_axislabel_direction("-") diff --git a/examples/axisartist/axis_direction_demo_step04.py b/examples/axisartist/axis_direction_demo_step04.py index 25ea10c0cff8..5769f2934e76 100644 --- a/examples/axisartist/axis_direction_demo_step04.py +++ b/examples/axisartist/axis_direction_demo_step04.py @@ -29,7 +29,7 @@ def setup_axes(fig, rect): fig = plt.figure(figsize=(6, 2.5)) fig.subplots_adjust(bottom=0.2, top=0.8) -ax1 = setup_axes(fig, "121") +ax1 = setup_axes(fig, 121) ax1.axis["x1"].label.set_text("rotation=0") ax1.axis["x1"].toggle(ticklabels=False) @@ -41,7 +41,7 @@ def setup_axes(fig, rect): xytext=(0, -10), textcoords="offset points", va="top", ha="center") -ax2 = setup_axes(fig, "122") +ax2 = setup_axes(fig, 122) ax2.axis["x1"].set_axislabel_direction("-") ax2.axis["x2"].set_axislabel_direction("-") diff --git a/examples/axisartist/simple_axis_direction01.py b/examples/axisartist/simple_axis_direction01.py index 79d074b2d860..2240ceece7e0 100644 --- a/examples/axisartist/simple_axis_direction01.py +++ b/examples/axisartist/simple_axis_direction01.py @@ -8,7 +8,7 @@ import mpl_toolkits.axisartist as axisartist fig = plt.figure(figsize=(4, 2.5)) -ax1 = fig.add_subplot(axisartist.Subplot(fig, "111")) +ax1 = fig.add_subplot(axisartist.Subplot(fig, 111)) fig.subplots_adjust(right=0.8) ax1.axis["left"].major_ticklabels.set_axis_direction("top") diff --git a/examples/axisartist/simple_axis_direction03.py b/examples/axisartist/simple_axis_direction03.py index 5185d144ab1f..e9b758b15817 100644 --- a/examples/axisartist/simple_axis_direction03.py +++ b/examples/axisartist/simple_axis_direction03.py @@ -22,13 +22,13 @@ def setup_axes(fig, rect): fig = plt.figure(figsize=(5, 2)) fig.subplots_adjust(wspace=0.4, bottom=0.3) -ax1 = setup_axes(fig, "121") +ax1 = setup_axes(fig, 121) ax1.set_xlabel("X-label") ax1.set_ylabel("Y-label") ax1.axis[:].invert_ticklabel_direction() -ax2 = setup_axes(fig, "122") +ax2 = setup_axes(fig, 122) ax2.set_xlabel("X-label") ax2.set_ylabel("Y-label") diff --git a/examples/color/color_demo.py b/examples/color/color_demo.py index 40a0e926b8dd..0ad1c11edfa9 100644 --- a/examples/color/color_demo.py +++ b/examples/color/color_demo.py @@ -6,23 +6,27 @@ Matplotlib recognizes the following formats to specify a color: 1) an RGB or RGBA tuple of float values in ``[0, 1]`` (e.g. ``(0.1, 0.2, 0.5)`` - or ``(0.1, 0.2, 0.5, 0.3)``). RGBA is short for Red, Green, Blue, Alpha; + or ``(0.1, 0.2, 0.5, 0.3)``). RGBA is short for Red, Green, Blue, Alpha; 2) a hex RGB or RGBA string (e.g., ``'#0F0F0F'`` or ``'#0F0F0F0F'``); -3) a string representation of a float value in ``[0, 1]`` inclusive for gray +3) a shorthand hex RGB or RGBA string, equivalent to the hex RGB or RGBA + string obtained by duplicating each character, (e.g., ``'#abc'``, equivalent + to ``'#aabbcc'``, or ``'#abcd'``, equivalent to ``'#aabbccdd'``); +4) a string representation of a float value in ``[0, 1]`` inclusive for gray level (e.g., ``'0.5'``); -4) a single letter string, i.e. one of - ``{'b', 'g', 'r', 'c', 'm', 'y', 'k', 'w'}``; -5) a X11/CSS4 ("html") color name, e.g. ``"blue"``; -6) a name from the `xkcd color survey `__, +5) a single letter string, i.e. one of + ``{'b', 'g', 'r', 'c', 'm', 'y', 'k', 'w'}``, which are short-hand notations + for shades of blue, green, red, cyan, magenta, yellow, black, and white; +6) a X11/CSS4 ("html") color name, e.g. ``"blue"``; +7) a name from the `xkcd color survey `__, prefixed with ``'xkcd:'`` (e.g., ``'xkcd:sky blue'``); -7) a "Cn" color spec, i.e. ``'C'`` followed by a number, which is an index into +8) a "Cn" color spec, i.e. ``'C'`` followed by a number, which is an index into the default property cycle (:rc:`axes.prop_cycle`); the indexing is intended to occur at rendering time, and defaults to black if the cycle does not include color. -8) one of ``{'tab:blue', 'tab:orange', 'tab:green', - 'tab:red', 'tab:purple', 'tab:brown', 'tab:pink', - 'tab:gray', 'tab:olive', 'tab:cyan'}`` which are the Tableau Colors from the - 'tab10' categorical palette (which is the default color cycle); +9) one of ``{'tab:blue', 'tab:orange', 'tab:green', 'tab:red', 'tab:purple', + 'tab:brown', 'tab:pink', 'tab:gray', 'tab:olive', 'tab:cyan'}`` which are + the Tableau Colors from the 'tab10' categorical palette (which is the + default color cycle); For more information on colors in matplotlib see diff --git a/examples/images_contours_and_fields/barcode_demo.py b/examples/images_contours_and_fields/barcode_demo.py index 9c71084ca492..de00656cf67e 100644 --- a/examples/images_contours_and_fields/barcode_demo.py +++ b/examples/images_contours_and_fields/barcode_demo.py @@ -1,33 +1,40 @@ """ -============ -Barcode Demo -============ - -This demo shows how to produce a one-dimensional image, or "bar code". +======= +Barcode +======= +This demo shows how to produce a bar code. + +The figure size is calculated so that the width in pixels is a multiple of the +number of data points to prevent interpolation artifacts. Additionally, the +``Axes`` is defined to span the whole figure and all ``Axis`` are turned off. + +The data itself is rendered with `~.Axes.imshow` using + +- ``code.reshape(1, -1)`` to turn the data into a 2D array with one row. +- ``imshow(..., aspect='auto')`` to allow for non-square pixels. +- ``imshow(..., interpolation='nearest')`` to prevent blurred edges. This + should not happen anyway because we fine-tuned the figure width in pixels, + but just to be safe. """ + import matplotlib.pyplot as plt import numpy as np -# Fixing random state for reproducibility -np.random.seed(19680801) - -# the bar -x = np.random.rand(500) > 0.7 - -barprops = dict(aspect='auto', cmap='binary', interpolation='nearest') - -fig = plt.figure() -# a vertical barcode -ax1 = fig.add_axes([0.1, 0.1, 0.1, 0.8]) -ax1.set_axis_off() -ax1.imshow(x.reshape((-1, 1)), **barprops) +code = np.array([ + 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 1, 1, + 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 0, 0, 0, 1, 0, 1, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1, 1, 0, 0, 1, + 1, 0, 0, 1, 1, 0, 1, 0, 1, 1, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 1]) -# a horizontal barcode -ax2 = fig.add_axes([0.3, 0.4, 0.6, 0.2]) -ax2.set_axis_off() -ax2.imshow(x.reshape((1, -1)), **barprops) +pixel_per_bar = 4 +dpi = 100 +fig = plt.figure(figsize=(len(code) * pixel_per_bar / dpi, 2), dpi=dpi) +ax = fig.add_axes([0, 0, 1, 1]) # span the whole figure +ax.set_axis_off() +ax.imshow(code.reshape(1, -1), cmap='binary', aspect='auto', + interpolation='nearest') plt.show() ############################################################################# @@ -43,3 +50,4 @@ import matplotlib matplotlib.axes.Axes.imshow matplotlib.pyplot.imshow +matplotlib.figure.Figure.add_axes diff --git a/examples/lines_bars_and_markers/curve_error_band.py b/examples/lines_bars_and_markers/curve_error_band.py new file mode 100644 index 000000000000..3d1675570b24 --- /dev/null +++ b/examples/lines_bars_and_markers/curve_error_band.py @@ -0,0 +1,84 @@ +""" +===================== +Curve with error band +===================== + +This example illustrates how to draw an error band around a parametrized curve. + +A parametrized curve x(t), y(t) can directly be drawn using `~.Axes.plot`. +""" +# sphinx_gallery_thumbnail_number = 2 + +import numpy as np +from scipy.interpolate import splprep, splev + +import matplotlib.pyplot as plt +from matplotlib.path import Path +from matplotlib.patches import PathPatch + +N = 400 +t = np.linspace(0, 2 * np.pi, N) +r = 0.5 + np.cos(t) +x, y = r * np.cos(t), r * np.sin(t) + +fig, ax = plt.subplots() +ax.plot(x, y) +plt.show() + +############################################################################# +# An error band can be used to indicate the uncertainty of the curve. +# In this example we assume that the error can be given as a scalar *err* +# that describes the uncertainty perpendicular to the curve in every point. +# +# We visualize this error as a colored band around the path using a +# `.PathPatch`. The patch is created from two path segments *(xp, yp)*, and +# *(xn, yn)* that are shifted by +/- *err* perpendicular to the curve *(x, y)*. +# +# Note: This method of using a `.PathPatch` is suited to arbitrary curves in +# 2D. If you just have a standard y-vs.-x plot, you can use the simpler +# `~.Axes.fill_between` method (see also +# :doc:`/gallery/lines_bars_and_markers/fill_between_demo`). + +# Error amplitudes depending on the curve parameter *t* +# (actual values are arbitrary and only for illustrative purposes): +err = 0.05 * np.sin(2 * t) ** 2 + 0.04 + 0.02 * np.cos(9 * t + 2) + +# calculate normals via derivatives of splines +tck, u = splprep([x, y], s=0) +dx, dy = splev(u, tck, der=1) +l = np.hypot(dx, dy) +nx = dy / l +ny = -dx / l + +# end points of errors +xp = x + nx * err +yp = y + ny * err +xn = x - nx * err +yn = y - ny * err + +vertices = np.block([[xp, xn[::-1]], + [yp, yn[::-1]]]).T +codes = Path.LINETO * np.ones(len(vertices), dtype=Path.code_type) +codes[0] = codes[len(xp)] = Path.MOVETO +path = Path(vertices, codes) + +patch = PathPatch(path, facecolor='C0', edgecolor='none', alpha=0.3) + +fig, ax = plt.subplots() +ax.plot(x, y) +ax.add_patch(patch) +plt.show() + +############################################################################# +# +# ------------ +# +# References +# """""""""" +# +# The use of the following functions, methods and classes is shown +# in this example: + +import matplotlib +matplotlib.patches.PathPatch +matplotlib.path.Path diff --git a/examples/lines_bars_and_markers/errorbar_limits_simple.py b/examples/lines_bars_and_markers/errorbar_limits_simple.py index e314783c2762..2a69b205b3ce 100644 --- a/examples/lines_bars_and_markers/errorbar_limits_simple.py +++ b/examples/lines_bars_and_markers/errorbar_limits_simple.py @@ -34,7 +34,7 @@ ############################################################################## -# Similarly ``xuplims``and ``xlolims`` can be used on the horizontal ``xerr`` +# Similarly ``xuplims`` and ``xlolims`` can be used on the horizontal ``xerr`` # errorbars. fig = plt.figure() diff --git a/examples/lines_bars_and_markers/fill.py b/examples/lines_bars_and_markers/fill.py index f254949cd212..e6d2e4293f35 100644 --- a/examples/lines_bars_and_markers/fill.py +++ b/examples/lines_bars_and_markers/fill.py @@ -20,8 +20,8 @@ def koch_snowflake(order, scale=10): """ Return two lists x, y of point coordinates of the Koch snowflake. - Arguments - --------- + Parameters + ---------- order : int The recursion depth. scale : float diff --git a/examples/lines_bars_and_markers/stackplot_demo.py b/examples/lines_bars_and_markers/stackplot_demo.py index 8df6d4f4cc8d..6c9acfcacc34 100644 --- a/examples/lines_bars_and_markers/stackplot_demo.py +++ b/examples/lines_bars_and_markers/stackplot_demo.py @@ -1,63 +1,71 @@ """ -============== -Stackplot Demo -============== +=========================== +Stackplots and streamgraphs +=========================== +""" + +############################################################################## +# Stackplots +# ---------- +# +# Stackplots draw multiple datasets as vertically stacked areas. This is +# useful when the individual data values and additionally their cumulative +# value are of interest. -How to create stackplots with Matplotlib. -Stackplots are generated by plotting different datasets vertically on -top of one another rather than overlapping with one another. Below we -show some examples to accomplish this with Matplotlib. -""" import numpy as np import matplotlib.pyplot as plt +# data from United Nations World Population Prospects (Revision 2019) +# https://population.un.org/wpp/, license: CC BY 3.0 IGO +year = [1950, 1960, 1970, 1980, 1990, 2000, 2010, 2018] +population_by_continent = { + 'africa': [228, 284, 365, 477, 631, 814, 1044, 1275], + 'americas': [340, 425, 519, 619, 727, 840, 943, 1006], + 'asia': [1394, 1686, 2120, 2625, 3202, 3714, 4169, 4560], + 'europe': [220, 253, 276, 295, 310, 303, 294, 293], + 'oceania': [12, 15, 19, 22, 26, 31, 36, 39], +} -# Fixing random state for reproducibility -np.random.seed(19680801) +fig, ax = plt.subplots() +ax.stackplot(year, population_by_continent.values(), + labels=population_by_continent.keys()) +ax.legend(loc='upper left') +ax.set_title('World population') +ax.set_xlabel('Year') +ax.set_ylabel('Number of people (millions)') -x = [1, 2, 3, 4, 5] -y1 = [1, 1, 2, 3, 5] -y2 = [0, 4, 2, 6, 8] -y3 = [1, 3, 5, 7, 9] +plt.show() -y = np.vstack([y1, y2, y3]) +############################################################################## +# Streamgraphs +# ------------ +# +# Using the *baseline* parameter, you can turn an ordinary stacked area plot +# with baseline 0 into a stream graph. -labels = ["Fibonacci ", "Evens", "Odds"] -fig, ax = plt.subplots() -ax.stackplot(x, y1, y2, y3, labels=labels) -ax.legend(loc='upper left') -plt.show() +# Fixing random state for reproducibility +np.random.seed(19680801) -fig, ax = plt.subplots() -ax.stackplot(x, y) -plt.show() -############################################################################### -# Here we show an example of making a streamgraph using stackplot - - -def layers(n, m): - """ - Return *n* random Gaussian mixtures, each of length *m*. - """ - def bump(a): - x = 1 / (.1 + np.random.random()) - y = 2 * np.random.random() - .5 - z = 10 / (.1 + np.random.random()) - for i in range(m): - w = (i / m - y) * z - a[i] += x * np.exp(-w * w) - a = np.zeros((m, n)) - for i in range(n): - for j in range(5): - bump(a[:, i]) +def gaussian_mixture(x, n=5): + """Return a random mixture of *n* Gaussians, evaluated at positions *x*.""" + def add_random_gaussian(a): + amplitude = 1 / (.1 + np.random.random()) + dx = x[-1] - x[0] + x0 = (2 * np.random.random() - .5) * dx + z = 10 / (.1 + np.random.random()) / dx + a += amplitude * np.exp(-(z * (x - x0))**2) + a = np.zeros_like(x) + for j in range(n): + add_random_gaussian(a) return a -d = layers(3, 100) +x = np.linspace(0, 100, 101) +ys = [gaussian_mixture(x) for _ in range(3)] fig, ax = plt.subplots() -ax.stackplot(range(100), d.T, baseline='wiggle') +ax.stackplot(x, ys, baseline='wiggle') plt.show() diff --git a/examples/misc/custom_projection.py b/examples/misc/custom_projection.py index 3994d0ffbd4a..14069bb7bf3c 100644 --- a/examples/misc/custom_projection.py +++ b/examples/misc/custom_projection.py @@ -53,7 +53,7 @@ def _init_axis(self): self._update_transScale() def cla(self): - Axes.cla(self) + super().cla() self.set_longitude_grid(30) self.set_latitude_grid(15) @@ -76,13 +76,13 @@ def _set_lim_and_transforms(self): # There are three important coordinate spaces going on here: # - # 1. Data space: The space of the data itself + # 1. Data space: The space of the data itself # - # 2. Axes space: The unit rectangle (0, 0) to (1, 1) - # covering the entire plot area. + # 2. Axes space: The unit rectangle (0, 0) to (1, 1) + # covering the entire plot area. # - # 3. Display space: The coordinates of the resulting image, - # often in pixels or dpi/inch. + # 3. Display space: The coordinates of the resulting image, + # often in pixels or dpi/inch. # This function makes heavy use of the Transform classes in # ``lib/matplotlib/transforms.py.`` For more information, see @@ -426,7 +426,7 @@ def inverted(self): def __init__(self, *args, **kwargs): self._longitude_cap = np.pi / 2.0 - GeoAxes.__init__(self, *args, **kwargs) + super().__init__(*args, **kwargs) self.set_aspect(0.5, adjustable='box', anchor='C') self.cla() diff --git a/examples/misc/rasterization_demo.py b/examples/misc/rasterization_demo.py index 96d8b5868ca6..8a1aed309550 100644 --- a/examples/misc/rasterization_demo.py +++ b/examples/misc/rasterization_demo.py @@ -3,51 +3,63 @@ Rasterization Demo ================== +Rasterization is a method where an image described in a vector graphics +format is being converted into a raster image (pixels). + +Individual artists can be rasterized for saving to a vector backend +such as PDF, SVG, or PS as embedded images. This can be useful to +reduce the file size of large artists, while maintaining the +advantages of vector graphics for other artists such as the axes +and annotations. For instance a complicated `~.Axes.pcolormesh` or +`~.Axes.contourf` can be made significantly simpler by rasterizing. +Note that the size and resolution of the rasterized artist is +controlled by its physical size and the value of the ``dpi`` kwarg +passed to `~.Figure.savefig`. """ + import numpy as np import matplotlib.pyplot as plt -d = np.arange(100).reshape(10, 10) +d = np.arange(100).reshape(10, 10) # the values to be color-mapped x, y = np.meshgrid(np.arange(11), np.arange(11)) theta = 0.25*np.pi -xx = x*np.cos(theta) - y*np.sin(theta) -yy = x*np.sin(theta) + y*np.cos(theta) +xx = x*np.cos(theta) - y*np.sin(theta) # rotate x by -theta +yy = x*np.sin(theta) + y*np.cos(theta) # rotate y by -theta + +# Plot the rasterized and non-rasterized plot +fig, ((ax1, ax2), (ax3, ax4)) = plt.subplots(2, 2, constrained_layout=True) -fig, ((ax1, ax2), (ax3, ax4)) = plt.subplots(2, 2) +# Create a pseudocolor non-rastertized plot with a non-regular rectangular grid ax1.set_aspect(1) ax1.pcolormesh(xx, yy, d) ax1.set_title("No Rasterization") +# Create a pseudocolor rastertized plot with a non-regular rectangular grid ax2.set_aspect(1) ax2.set_title("Rasterization") +m = ax2.pcolormesh(xx, yy, d, rasterized=True) -m = ax2.pcolormesh(xx, yy, d) -m.set_rasterized(True) - +# Create a pseudocolor non-rastertized plot with a non-regular rectangular +# grid and an overlapped "Text" ax3.set_aspect(1) ax3.pcolormesh(xx, yy, d) ax3.text(0.5, 0.5, "Text", alpha=0.2, va="center", ha="center", size=50, transform=ax3.transAxes) - ax3.set_title("No Rasterization") - +# Create a pseudocolor rastertized plot with a non-regular rectangular +# grid and an overlapped "Text" ax4.set_aspect(1) -m = ax4.pcolormesh(xx, yy, d) -m.set_zorder(-20) - -ax4.text(0.5, 0.5, "Text", alpha=0.2, - zorder=-15, +m = ax4.pcolormesh(xx, yy, d, zorder=-20) +ax4.text(0.5, 0.5, "Text", alpha=0.2, zorder=-15, va="center", ha="center", size=50, transform=ax4.transAxes) - +# Set zorder value below which artists will be rasterized ax4.set_rasterization_zorder(-10) - ax4.set_title("Rasterization z$<-10$") - - # ax2.title.set_rasterized(True) # should display a warning +# Save files in pdf and eps format plt.savefig("test_rasterization.pdf", dpi=150) plt.savefig("test_rasterization.eps", dpi=150) diff --git a/examples/misc/set_and_get.py b/examples/misc/set_and_get.py index 2b5b076bf9c1..8d217cf94660 100644 --- a/examples/misc/set_and_get.py +++ b/examples/misc/set_and_get.py @@ -1,15 +1,16 @@ """ -=========== -Set And Get -=========== +====================== +Set and get properties +====================== -The pyplot interface allows you to use setp and getp to set and get -object properties, as well as to do introspection on the object +The pyplot interface allows you to use ``setp`` and ``getp`` to +set and get object properties respectively, as well as to do +introspection on the object. -set -=== +Setting with ``setp`` +===================== -To set the linestyle of a line to be dashed, you can do:: +To set the linestyle of a line to be dashed, you use ``setp``:: >>> line, = plt.plot([1, 2, 3]) >>> plt.setp(line, linestyle='--') @@ -25,11 +26,11 @@ >>> plt.setp(line) -set operates on a single instance or a list of instances. If you are -in query mode introspecting the possible values, only the first +``setp`` operates on a single instance or a list of instances. If you +are in query mode introspecting the possible values, only the first instance in the sequence is used. When actually setting values, all -the instances will be set. e.g., suppose you have a list of two lines, -the following will make both lines thicker and red:: +the instances will be set. For example, suppose you have a list of +two lines, the following will make both lines thicker and red:: >>> x = np.arange(0, 1, 0.01) >>> y1 = np.sin(2*np.pi*x) @@ -38,10 +39,10 @@ >>> plt.setp(lines, linewidth=2, color='r') -get -=== +Getting with ``getp`` +===================== -get returns the value of a given attribute. You can use get to query +``getp`` returns the value of a given attribute. You can use it to query the value of a single attribute:: >>> plt.getp(line, 'linewidth') @@ -64,7 +65,7 @@ To reduce keystrokes in interactive mode, a number of properties have short aliases, e.g., 'lw' for 'linewidth' and 'mec' for 'markeredgecolor'. When calling set or get in introspection mode, -these properties will be listed as 'fullname or aliasname'. +these properties will be listed as 'fullname' or 'aliasname'. """ diff --git a/examples/mplot3d/voxels_torus.py b/examples/mplot3d/voxels_torus.py index dd21cf3af103..11b5a0b05f62 100644 --- a/examples/mplot3d/voxels_torus.py +++ b/examples/mplot3d/voxels_torus.py @@ -3,7 +3,7 @@ 3D voxel / volumetric plot with cylindrical coordinates ======================================================= -Demonstrates using the *x*, *y*, *z* arguments of `.Axes3D.voxels`. +Demonstrates using the *x*, *y*, *z* parameters of `.Axes3D.voxels`. """ import matplotlib.pyplot as plt diff --git a/examples/pie_and_polar_charts/pie_features.py b/examples/pie_and_polar_charts/pie_features.py index d52f3a699aee..83fe35da9444 100644 --- a/examples/pie_and_polar_charts/pie_features.py +++ b/examples/pie_and_polar_charts/pie_features.py @@ -7,11 +7,11 @@ In addition to the basic pie chart, this demo shows a few optional features: - * slice labels - * auto-labeling the percentage - * offsetting a slice with "explode" - * drop-shadow - * custom start angle +* slice labels +* auto-labeling the percentage +* offsetting a slice with "explode" +* drop-shadow +* custom start angle Note about the custom start angle: diff --git a/examples/pyplots/pyplot_simple.py b/examples/pyplots/pyplot_simple.py index 025c7b65ee40..25bb924c76ed 100644 --- a/examples/pyplots/pyplot_simple.py +++ b/examples/pyplots/pyplot_simple.py @@ -3,7 +3,9 @@ Pyplot Simple ============= -A most simple plot, where a list of numbers is plotted against their index. +A very simple pyplot where a list of numbers are ploted against their +index. Creates a straight line due to the rate of change being 1 for +both the X and Y axis. """ import matplotlib.pyplot as plt plt.plot([1, 2, 3, 4]) diff --git a/examples/recipes/create_subplots.py b/examples/recipes/create_subplots.py deleted file mode 100644 index 3c641a8f9d56..000000000000 --- a/examples/recipes/create_subplots.py +++ /dev/null @@ -1,45 +0,0 @@ -""" -Easily creating subplots -======================== - -In early versions of matplotlib, if you wanted to use the pythonic API -and create a figure instance and from that create a grid of subplots, -possibly with shared axes, it involved a fair amount of boilerplate -code. e.g. -""" - -import matplotlib.pyplot as plt -import numpy as np - - -# Fixing random state for reproducibility -np.random.seed(19680801) - -x = np.random.randn(50) - -# old style -fig = plt.figure() -ax1 = fig.add_subplot(221) -ax2 = fig.add_subplot(222, sharex=ax1, sharey=ax1) -ax3 = fig.add_subplot(223, sharex=ax1, sharey=ax1) -ax3 = fig.add_subplot(224, sharex=ax1, sharey=ax1) - -############################################################################### -# Fernando Perez has provided the nice top-level function -# `~matplotlib.pyplot.subplots` (note the "s" at the end) to create -# everything at once, and turn on x and y sharing for the whole bunch. -# You can either unpack the axes individually... - -# new style method 1; unpack the axes -fig, ((ax1, ax2), (ax3, ax4)) = plt.subplots(2, 2, sharex=True, sharey=True) -ax1.plot(x) - -############################################################################### -# or get them back as a numrows x numcolumns object array which supports -# numpy indexing - -# new style method 2; use an axes array -fig, axs = plt.subplots(2, 2, sharex=True, sharey=True) -axs[0, 0].plot(x) - -plt.show() diff --git a/examples/shapes_and_collections/arrow_guide.py b/examples/shapes_and_collections/arrow_guide.py index e895b48cdd7b..239f30cb056b 100644 --- a/examples/shapes_and_collections/arrow_guide.py +++ b/examples/shapes_and_collections/arrow_guide.py @@ -18,9 +18,9 @@ Here we show three use cases for plotting arrows, depending on whether the head or anchor points need to be fixed in data or display space: - 1. Head shape fixed in display space, anchor points fixed in data space - 2. Head shape and anchor points fixed in display space - 3. Entire patch fixed in data space +1. Head shape fixed in display space, anchor points fixed in data space +2. Head shape and anchor points fixed in display space +3. Entire patch fixed in data space Below each use case is presented in turn. """ diff --git a/examples/shapes_and_collections/hatch_demo.py b/examples/shapes_and_collections/hatch_demo.py index 66ea648f60d7..3796211c31a3 100644 --- a/examples/shapes_and_collections/hatch_demo.py +++ b/examples/shapes_and_collections/hatch_demo.py @@ -1,37 +1,48 @@ """ ========== -Hatch Demo +Hatch demo ========== -Hatching (pattern filled polygons) is supported currently in the PS, -PDF, SVG and Agg backends only. +Hatches can be added to most polygons in Matplotlib, including `~.Axes.bar`, +`~.Axes.fill_between`, `~.Axes.contourf`, and childern of `~.patches.Polygon`. +They are currently supported in the PS, PDF, SVG, OSX, and Agg backends. The WX +and Cairo backends do not currently support hatching. + +See also :doc:`/gallery/images_contours_and_fields/contourf_hatching` for +an example using `~.Axes.contourf`, and +:doc:`/gallery/shapes_and_collections/hatch_style_reference` for swatches +of the existing hatches. + """ + +import numpy as np import matplotlib.pyplot as plt from matplotlib.patches import Ellipse, Polygon -fig, (ax1, ax2, ax3) = plt.subplots(3) - -ax1.bar(range(1, 5), range(1, 5), color='red', edgecolor='black', hatch="/") -ax1.bar(range(1, 5), [6] * 4, bottom=range(1, 5), - color='blue', edgecolor='black', hatch='//') -ax1.set_xticks([1.5, 2.5, 3.5, 4.5]) +x = np.arange(1, 5) +y1 = np.arange(1, 5) +y2 = np.ones(y1.shape) * 4 -bars = ax2.bar(range(1, 5), range(1, 5), color='yellow', ecolor='black') + \ - ax2.bar(range(1, 5), [6] * 4, bottom=range(1, 5), - color='green', ecolor='black') -ax2.set_xticks([1.5, 2.5, 3.5, 4.5]) +fig = plt.figure() +axs = fig.subplot_mosaic([['bar1', 'patches'], ['bar2', 'patches']]) -patterns = ('-', '+', 'x', '\\', '*', 'o', 'O', '.') -for bar, pattern in zip(bars, patterns): - bar.set_hatch(pattern) +axs['bar1'].bar(x, y1, edgecolor='black', hatch="/") +axs['bar1'].bar(x, y2, bottom=y1, edgecolor='black', hatch='//') -ax3.fill([1, 3, 3, 1], [1, 1, 2, 2], fill=False, hatch='\\') -ax3.add_patch(Ellipse((4, 1.5), 4, 0.5, fill=False, hatch='*')) -ax3.add_patch(Polygon([[0, 0], [4, 1.1], [6, 2.5], [2, 1.4]], closed=True, - fill=False, hatch='/')) -ax3.set_xlim((0, 6)) -ax3.set_ylim((0, 2.5)) +axs['bar2'].bar(x, y1, edgecolor='black', hatch=['--', '+', 'x', '\\']) +axs['bar2'].bar(x, y2, bottom=y1, edgecolor='black', + hatch=['*', 'o', 'O', '.']) +x = np.arange(0, 40, 0.2) +axs['patches'].fill_between(x, np.sin(x) * 4 + 30, y2=0, + hatch='///', zorder=2, fc='c') +axs['patches'].add_patch(Ellipse((4, 50), 10, 10, fill=True, + hatch='*', facecolor='y')) +axs['patches'].add_patch(Polygon([(10, 20), (30, 50), (50, 10)], + hatch='\\/...', facecolor='g')) +axs['patches'].set_xlim([0, 40]) +axs['patches'].set_ylim([10, 60]) +axs['patches'].set_aspect(1) plt.show() ############################################################################# diff --git a/examples/shapes_and_collections/hatch_style_reference.py b/examples/shapes_and_collections/hatch_style_reference.py new file mode 100644 index 000000000000..f3f38d29f0b7 --- /dev/null +++ b/examples/shapes_and_collections/hatch_style_reference.py @@ -0,0 +1,67 @@ +""" +===================== +Hatch style reference +===================== + +Hatches can be added to most polygons in Matplotlib, including `~.Axes.bar`, +`~.Axes.fill_between`, `~.Axes.contourf`, and childern of `~.patches.Polygon`. +They are currently supported in the PS, PDF, SVG, OSX, and Agg backends. The WX +and Cairo backends do not currently support hatching. + +See also :doc:`/gallery/images_contours_and_fields/contourf_hatching` for +an example using `~.Axes.contourf`, and +:doc:`/gallery/shapes_and_collections/hatch_demo` for more usage examples. + +""" +import matplotlib.pyplot as plt +from matplotlib.patches import Rectangle + +fig, axs = plt.subplots(2, 5, constrained_layout=True, figsize=(6.4, 3.2)) + +hatches = ['/', '\\', '|', '-', '+', 'x', 'o', 'O', '.', '*'] + + +def hatches_plot(ax, h): + ax.add_patch(Rectangle((0, 0), 2, 2, fill=False, hatch=h)) + ax.text(1, -0.5, f"' {h} '", size=15, ha="center") + ax.axis('equal') + ax.axis('off') + +for ax, h in zip(axs.flat, hatches): + hatches_plot(ax, h) + +############################################################################### +# Hatching patterns can be repeated to increase the density. + +fig, axs = plt.subplots(2, 5, constrained_layout=True, figsize=(6.4, 3.2)) + +hatches = ['//', '\\\\', '||', '--', '++', 'xx', 'oo', 'OO', '..', '**'] + +for ax, h in zip(axs.flat, hatches): + hatches_plot(ax, h) + +############################################################################### +# Hatching patterns can be combined to create additional patterns. + +fig, axs = plt.subplots(2, 5, constrained_layout=True, figsize=(6.4, 3.2)) + +hatches = ['/o', '\\|', '|*', '-\\', '+o', 'x*', 'o-', 'O|', 'O.', '*-'] + +for ax, h in zip(axs.flat, hatches): + hatches_plot(ax, h) + +############################################################################# +# +# ------------ +# +# References +# """""""""" +# +# The use of the following functions, methods, classes and modules is shown +# in this example: + +import matplotlib +matplotlib.patches +matplotlib.patches.Rectangle +matplotlib.axes.Axes.add_patch +matplotlib.axes.Axes.text diff --git a/examples/showcase/integral.py b/examples/showcase/integral.py index f5ffbe05edff..06f95d8dec08 100644 --- a/examples/showcase/integral.py +++ b/examples/showcase/integral.py @@ -5,12 +5,12 @@ Although this is a simple example, it demonstrates some important tweaks: - * A simple line plot with custom color and line width. - * A shaded region created using a Polygon patch. - * A text label with mathtext rendering. - * figtext calls to label the x- and y-axes. - * Use of axis spines to hide the top and right spines. - * Custom tick placement and labels. +* A simple line plot with custom color and line width. +* A shaded region created using a Polygon patch. +* A text label with mathtext rendering. +* figtext calls to label the x- and y-axes. +* Use of axis spines to hide the top and right spines. +* Custom tick placement and labels. """ import numpy as np import matplotlib.pyplot as plt diff --git a/examples/showcase/mandelbrot.py b/examples/showcase/mandelbrot.py index 6f979104cefc..53db00ae3d0d 100644 --- a/examples/showcase/mandelbrot.py +++ b/examples/showcase/mandelbrot.py @@ -42,7 +42,7 @@ def mandelbrot_set(xmin, xmax, ymin, ymax, xn, yn, maxiter, horizon=2.0): # Normalized recount as explained in: # https://linas.org/art-gallery/escape/smooth.html - # https://www.ibm.com/developerworks/community/blogs/jfp/entry/My_Christmas_Gift + # https://web.archive.org/web/20160331171238/https://www.ibm.com/developerworks/community/blogs/jfp/entry/My_Christmas_Gift?lang=en # This line will generate warnings for null values but it is faster to # process them afterwards using the nan_to_num diff --git a/examples/specialty_plots/leftventricle_bulleye.py b/examples/specialty_plots/leftventricle_bulleye.py index 1d98f5e8bfa0..4dc9ac231236 100644 --- a/examples/specialty_plots/leftventricle_bulleye.py +++ b/examples/specialty_plots/leftventricle_bulleye.py @@ -28,10 +28,9 @@ def bullseye_plot(ax, data, seg_bold=None, cmap=None, norm=None): norm : Normalize or None, optional Optional argument to normalize data into the [0.0, 1.0] range - Notes ----- - This function create the 17 segment model for the left ventricle according + This function creates the 17 segment model for the left ventricle according to the American Heart Association (AHA) [1]_ References @@ -135,7 +134,7 @@ def bullseye_plot(ax, data, seg_bold=None, cmap=None, norm=None): # Make a figure and axes with dimensions as desired. fig, ax = plt.subplots(figsize=(12, 8), nrows=1, ncols=3, subplot_kw=dict(projection='polar')) -fig.canvas.set_window_title('Left Ventricle Bulls Eyes (AHA)') +fig.canvas.manager.set_window_title('Left Ventricle Bulls Eyes (AHA)') # Create the axis for the colorbars axl = fig.add_axes([0.14, 0.15, 0.2, 0.05]) diff --git a/examples/specialty_plots/skewt.py b/examples/specialty_plots/skewt.py index f77afcc49f10..852adeac01ae 100644 --- a/examples/specialty_plots/skewt.py +++ b/examples/specialty_plots/skewt.py @@ -46,7 +46,7 @@ def draw(self, renderer): self.tick2line.get_visible() and needs_upper) self.label2.set_visible( self.label2.get_visible() and needs_upper) - super(SkewXTick, self).draw(renderer) + super().draw(renderer) def get_view_interval(self): return self.axes.xaxis.get_view_interval() diff --git a/examples/statistics/barchart_demo.py b/examples/statistics/barchart_demo.py index a8d78b96363c..e9c2b94c0b95 100644 --- a/examples/statistics/barchart_demo.py +++ b/examples/statistics/barchart_demo.py @@ -67,7 +67,7 @@ def format_ycursor(y): def plot_student_results(student, scores, cohort_size): fig, ax1 = plt.subplots(figsize=(9, 7)) # Create the figure fig.subplots_adjust(left=0.115, right=0.88) - fig.canvas.set_window_title('Eldorado K-8 Fitness Chart') + fig.canvas.manager.set_window_title('Eldorado K-8 Fitness Chart') pos = np.arange(len(test_names)) diff --git a/examples/statistics/boxplot_demo.py b/examples/statistics/boxplot_demo.py index dbf272c430dc..84daaef90cb4 100644 --- a/examples/statistics/boxplot_demo.py +++ b/examples/statistics/boxplot_demo.py @@ -102,7 +102,7 @@ ] fig, ax1 = plt.subplots(figsize=(10, 6)) -fig.canvas.set_window_title('A Boxplot Example') +fig.canvas.manager.set_window_title('A Boxplot Example') fig.subplots_adjust(left=0.075, right=0.95, top=0.9, bottom=0.25) bp = ax1.boxplot(data, notch=0, sym='+', vert=1, whis=1.5) diff --git a/examples/statistics/confidence_ellipse.py b/examples/statistics/confidence_ellipse.py index e7e6f54eaf1c..b2978af64d49 100644 --- a/examples/statistics/confidence_ellipse.py +++ b/examples/statistics/confidence_ellipse.py @@ -209,7 +209,7 @@ def get_correlated_dataset(n, dependency, mu, scale): ax_kwargs.scatter(x, y, s=0.5) ax_kwargs.scatter(mu[0], mu[1], c='red', s=3) -ax_kwargs.set_title(f'Using kwargs') +ax_kwargs.set_title('Using kwargs') fig.subplots_adjust(hspace=0.25) plt.show() diff --git a/examples/statistics/histogram_multihist.py b/examples/statistics/histogram_multihist.py index f96d21867a55..a75396890020 100644 --- a/examples/statistics/histogram_multihist.py +++ b/examples/statistics/histogram_multihist.py @@ -5,10 +5,10 @@ Plot histogram with multiple sample sets and demonstrate: - * Use of legend with multiple sample sets - * Stacked bars - * Step curve with no fill - * Data sets of different sample sizes +* Use of legend with multiple sample sets +* Stacked bars +* Step curve with no fill +* Data sets of different sample sizes Selecting different bin counts and sizes can significantly affect the shape of a histogram. The Astropy docs have a great section on how to diff --git a/examples/subplots_axes_and_figures/figure_title.py b/examples/subplots_axes_and_figures/figure_title.py index 1c54c3887be7..8118f9cabbd4 100644 --- a/examples/subplots_axes_and_figures/figure_title.py +++ b/examples/subplots_axes_and_figures/figure_title.py @@ -1,34 +1,27 @@ """ ============ -Figure Title +Figure title ============ -Create a figure with separate subplot titles and a centered figure title. +Each subplot can have its own title (`.Axes.set_title`). Additionally, +`.Figure.suptitle` adds a centered title at the top of the figure. """ import matplotlib.pyplot as plt import numpy as np -def f(t): - s1 = np.cos(2*np.pi*t) - e1 = np.exp(-t) - return s1 * e1 +x = np.linspace(0.0, 5.0, 501) -t1 = np.arange(0.0, 5.0, 0.1) -t2 = np.arange(0.0, 5.0, 0.02) -t3 = np.arange(0.0, 2.0, 0.01) +fig, (ax1, ax2) = plt.subplots(1, 2, constrained_layout=True, sharey=True) +ax1.plot(x, np.cos(6*x) * np.exp(-x)) +ax1.set_title('damped') +ax1.set_xlabel('time (s)') +ax1.set_ylabel('amplitude') +ax2.plot(x, np.cos(6*x)) +ax2.set_xlabel('time (s)') +ax2.set_title('undamped') -fig, axs = plt.subplots(2, 1, constrained_layout=True) -axs[0].plot(t1, f(t1), 'o', t2, f(t2), '-') -axs[0].set_title('subplot 1') -axs[0].set_xlabel('distance (m)') -axs[0].set_ylabel('Damped oscillation') -fig.suptitle('This is a somewhat long figure title', fontsize=16) - -axs[1].plot(t3, np.cos(2*np.pi*t3), '--') -axs[1].set_xlabel('time (s)') -axs[1].set_title('subplot 2') -axs[1].set_ylabel('Undamped') +fig.suptitle('Different types of oscillations', fontsize=16) plt.show() diff --git a/examples/text_labels_and_annotations/line_with_text.py b/examples/text_labels_and_annotations/line_with_text.py index c876f6887948..ffacab587f92 100644 --- a/examples/text_labels_and_annotations/line_with_text.py +++ b/examples/text_labels_and_annotations/line_with_text.py @@ -17,7 +17,7 @@ class MyLine(lines.Line2D): def __init__(self, *args, **kwargs): # we'll update the position when the line data is set self.text = mtext.Text(0, 0, '') - lines.Line2D.__init__(self, *args, **kwargs) + super().__init__(*args, **kwargs) # we can't access the label attr until *after* the line is # initiated @@ -25,27 +25,27 @@ def __init__(self, *args, **kwargs): def set_figure(self, figure): self.text.set_figure(figure) - lines.Line2D.set_figure(self, figure) + super().set_figure(figure) def set_axes(self, axes): self.text.set_axes(axes) - lines.Line2D.set_axes(self, axes) + super().set_axes(axes) def set_transform(self, transform): # 2 pixel offset texttrans = transform + mtransforms.Affine2D().translate(2, 2) self.text.set_transform(texttrans) - lines.Line2D.set_transform(self, transform) + super().set_transform(transform) def set_data(self, x, y): if len(x): self.text.set_position((x[-1], y[-1])) - lines.Line2D.set_data(self, x, y) + super().set_data(x, y) def draw(self, renderer): # draw my label at the end of the line with 2 pixel offset - lines.Line2D.draw(self, renderer) + super().draw(renderer) self.text.draw(renderer) # Fixing random state for reproducibility diff --git a/examples/ticks_and_spines/tick-formatters.py b/examples/ticks_and_spines/tick-formatters.py index 4533ea74df0c..d410c90192cf 100644 --- a/examples/ticks_and_spines/tick-formatters.py +++ b/examples/ticks_and_spines/tick-formatters.py @@ -73,6 +73,7 @@ def setup(ax, title): setup(axs1[1], title="StrMethodFormatter('{x:.3f}')") axs1[1].xaxis.set_major_formatter(ticker.StrMethodFormatter("{x:.3f}")) + # FuncFormatter can be used as a decorator @ticker.FuncFormatter def major_formatter(x, pos): diff --git a/examples/units/basic_units.py b/examples/units/basic_units.py index cec4657bfa75..2a8e94887e95 100644 --- a/examples/units/basic_units.py +++ b/examples/units/basic_units.py @@ -43,7 +43,7 @@ def __call__(self, *args): class ConvertArgsProxy(PassThroughProxy): def __init__(self, fn_name, obj): - PassThroughProxy.__init__(self, fn_name, obj) + super().__init__(fn_name, obj) self.unit = obj.unit def __call__(self, *args): @@ -54,23 +54,23 @@ def __call__(self, *args): except AttributeError: converted_args.append(TaggedValue(a, self.unit)) converted_args = tuple([c.get_value() for c in converted_args]) - return PassThroughProxy.__call__(self, *converted_args) + return super().__call__(*converted_args) class ConvertReturnProxy(PassThroughProxy): def __init__(self, fn_name, obj): - PassThroughProxy.__init__(self, fn_name, obj) + super().__init__(fn_name, obj) self.unit = obj.unit def __call__(self, *args): - ret = PassThroughProxy.__call__(self, *args) + ret = super().__call__(*args) return (NotImplemented if ret is NotImplemented else TaggedValue(ret, self.unit)) class ConvertAllProxy(PassThroughProxy): def __init__(self, fn_name, obj): - PassThroughProxy.__init__(self, fn_name, obj) + super().__init__(fn_name, obj) self.unit = obj.unit def __call__(self, *args): @@ -96,7 +96,7 @@ def __call__(self, *args): else: arg_units.append(None) converted_args = tuple(converted_args) - ret = PassThroughProxy.__call__(self, *converted_args) + ret = super().__call__(*converted_args) if ret is NotImplemented: return NotImplemented ret_unit = unit_resolver(self.fn_name, arg_units) diff --git a/examples/user_interfaces/embedding_webagg_sgskip.py b/examples/user_interfaces/embedding_webagg_sgskip.py index 33cafb860d80..d4c0e7e9e6f2 100644 --- a/examples/user_interfaces/embedding_webagg_sgskip.py +++ b/examples/user_interfaces/embedding_webagg_sgskip.py @@ -60,9 +60,6 @@ def create_figure(): type="text/css" /> - - - - diff --git a/lib/matplotlib/backends/web_backend/css/mpl.css b/lib/matplotlib/backends/web_backend/css/mpl.css index 61ceb7163866..e55733d25ecf 100644 --- a/lib/matplotlib/backends/web_backend/css/mpl.css +++ b/lib/matplotlib/backends/web_backend/css/mpl.css @@ -1,3 +1,24 @@ +/* General styling */ +.ui-helper-clearfix:before, +.ui-helper-clearfix:after { + content: ""; + display: table; + border-collapse: collapse; +} +.ui-helper-clearfix:after { + clear: both; +} + +/* Header */ +.ui-widget-header { + border: 1px solid #dddddd; + border-top-left-radius: 6px; + border-top-right-radius: 6px; + background: #e9e9e9; + color: #333333; + font-weight: bold; +} + /* Toolbar and items */ .mpl-toolbar { width: 100%; diff --git a/lib/matplotlib/backends/web_backend/css/page.css b/lib/matplotlib/backends/web_backend/css/page.css index d284be1f59c4..c380ef0a3ffc 100644 --- a/lib/matplotlib/backends/web_backend/css/page.css +++ b/lib/matplotlib/backends/web_backend/css/page.css @@ -78,5 +78,6 @@ span#login_widget { #figure-div { display: inline-block; margin: 10px; + vertical-align: top; } diff --git a/lib/matplotlib/backends/web_backend/js/mpl.js b/lib/matplotlib/backends/web_backend/js/mpl.js index c1455bbd9c5e..9eeb14f399e0 100644 --- a/lib/matplotlib/backends/web_backend/js/mpl.js +++ b/lib/matplotlib/backends/web_backend/js/mpl.js @@ -46,8 +46,8 @@ mpl.figure = function (figure_id, websocket, ondownload, parent_element) { this.image_mode = 'full'; this.root = document.createElement('div'); - this._root_extra_style(this.root); this.root.setAttribute('style', 'display: inline-block'); + this._root_extra_style(this.root); parent_element.appendChild(this.root); @@ -112,7 +112,15 @@ mpl.figure.prototype._init_canvas = function () { var canvas_div = (this.canvas_div = document.createElement('div')); canvas_div.setAttribute( 'style', - 'position: relative; clear: both; outline: 0' + 'border: 1px solid #ddd;' + + 'box-sizing: content-box;' + + 'clear: both;' + + 'min-height: 1px;' + + 'min-width: 1px;' + + 'outline: 0;' + + 'overflow: hidden;' + + 'position: relative;' + + 'resize: both;' ); function on_keyboard_event_closure(name) { @@ -135,7 +143,7 @@ mpl.figure.prototype._init_canvas = function () { var canvas = (this.canvas = document.createElement('canvas')); canvas.classList.add('mpl-canvas'); - canvas.setAttribute('style', 'left: 0; top: 0; z-index: 0; outline: 0'); + canvas.setAttribute('style', 'box-sizing: content-box;'); this.context = canvas.getContext('2d'); @@ -155,29 +163,67 @@ mpl.figure.prototype._init_canvas = function () { )); rubberband_canvas.setAttribute( 'style', - 'position: absolute; left: 0; top: 0; z-index: 1;' + 'box-sizing: content-box; position: absolute; left: 0; top: 0; z-index: 1;' ); - var pass_mouse_events = true; - - $(canvas_div).resizable({ - start: function (_event, _ui) { - pass_mouse_events = false; - }, - resize: function (_event, ui) { - fig.request_resize(ui.size.width, ui.size.height); - }, - stop: function (_event, ui) { - pass_mouse_events = true; - fig.request_resize(ui.size.width, ui.size.height); - }, + var resizeObserver = new ResizeObserver(function (entries) { + var nentries = entries.length; + for (var i = 0; i < nentries; i++) { + var entry = entries[i]; + var width, height; + if (entry.contentBoxSize) { + if (entry.contentBoxSize instanceof Array) { + // Chrome 84 implements new version of spec. + width = entry.contentBoxSize[0].inlineSize; + height = entry.contentBoxSize[0].blockSize; + } else { + // Firefox implements old version of spec. + width = entry.contentBoxSize.inlineSize; + height = entry.contentBoxSize.blockSize; + } + } else { + // Chrome <84 implements even older version of spec. + width = entry.contentRect.width; + height = entry.contentRect.height; + } + + // Keep the size of the canvas and rubber band canvas in sync with + // the canvas container. + if (entry.devicePixelContentBoxSize) { + // Chrome 84 implements new version of spec. + canvas.setAttribute( + 'width', + entry.devicePixelContentBoxSize[0].inlineSize + ); + canvas.setAttribute( + 'height', + entry.devicePixelContentBoxSize[0].blockSize + ); + } else { + canvas.setAttribute('width', width * mpl.ratio); + canvas.setAttribute('height', height * mpl.ratio); + } + canvas.setAttribute( + 'style', + 'width: ' + width + 'px; height: ' + height + 'px;' + ); + + rubberband_canvas.setAttribute('width', width); + rubberband_canvas.setAttribute('height', height); + + // And update the size in Python. We ignore the initial 0/0 size + // that occurs as the element is placed into the DOM, which should + // otherwise not happen due to the minimum size styling. + if (width != 0 && height != 0) { + fig.request_resize(width, height); + } + } }); + resizeObserver.observe(canvas_div); function on_mouse_event_closure(name) { return function (event) { - if (pass_mouse_events) { - return fig.mouse_event(event, name); - } + return fig.mouse_event(event, name); }; } @@ -219,29 +265,16 @@ mpl.figure.prototype._init_canvas = function () { this.rubberband_context = rubberband_canvas.getContext('2d'); this.rubberband_context.strokeStyle = '#000000'; - this._resize_canvas = function (width, height) { - // Keep the size of the canvas, canvas container, and rubber band - // canvas in synch. - canvas_div.style.width = width; - canvas_div.style.height = height; - - canvas.setAttribute('width', width * mpl.ratio); - canvas.setAttribute('height', height * mpl.ratio); - canvas.setAttribute( - 'style', - 'width: ' + width + 'px; height: ' + height + 'px;' - ); - - rubberband_canvas.setAttribute('width', width); - rubberband_canvas.setAttribute('height', height); + this._resize_canvas = function (width, height, forward) { + if (forward) { + canvas_div.style.width = width + 'px'; + canvas_div.style.height = height + 'px'; + } }; - // Set the figure to an initial 600x600px, this will subsequently be updated - // upon first draw. - this._resize_canvas(600, 600); - // Disable right mouse context menu. this.rubberband_canvas.addEventListener('contextmenu', function (_e) { + event.preventDefault(); return false; }); @@ -360,7 +393,7 @@ mpl.figure.prototype.handle_save = function (fig, _msg) { mpl.figure.prototype.handle_resize = function (fig, msg) { var size = msg['size']; if (size[0] !== fig.canvas.width || size[1] !== fig.canvas.height) { - fig._resize_canvas(size[0], size[1]); + fig._resize_canvas(size[0], size[1], msg['forward']); fig.send_message('refresh', {}); } }; diff --git a/lib/matplotlib/backends/web_backend/js/nbagg_mpl.js b/lib/matplotlib/backends/web_backend/js/nbagg_mpl.js index 03f46fa6cb98..3d56f1fe8ab9 100644 --- a/lib/matplotlib/backends/web_backend/js/nbagg_mpl.js +++ b/lib/matplotlib/backends/web_backend/js/nbagg_mpl.js @@ -176,6 +176,7 @@ mpl.figure.prototype._remove_fig_handler = function () { }; mpl.figure.prototype._root_extra_style = function (el) { + el.style.boxSizing = 'content-box'; // override notebook setting of border-box. el.addEventListener('remove', this._remove_fig_handler); }; diff --git a/lib/matplotlib/backends/web_backend/single_figure.html b/lib/matplotlib/backends/web_backend/single_figure.html index 664cf57006fa..71fe451f6f14 100644 --- a/lib/matplotlib/backends/web_backend/single_figure.html +++ b/lib/matplotlib/backends/web_backend/single_figure.html @@ -4,9 +4,6 @@ - - -