diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index d2c2ba2c5b74..19e6aa1079b2 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -6,8 +6,8 @@ body: id: summary attributes: label: Bug summary - description: Describe the bug in 1-2 short sentences - placeholder: + description: Describe the bug in 1-2 short sentences + placeholder: value: validations: required: true @@ -15,7 +15,7 @@ body: id: reproduction attributes: label: Code for reproduction - description: If possible, please provide a minimum self-contained example. + description: If possible, please provide a minimum self-contained example. placeholder: Paste your code here render: python validations: @@ -59,7 +59,7 @@ body: required: true - type: input id: matplotlib-backend - attributes: + attributes: label: Matplotlib Backend description: "From Python prompt: `import matplotlib; print(matplotlib.get_backend())`" - type: input diff --git a/.github/ISSUE_TEMPLATE/documentation.yml b/.github/ISSUE_TEMPLATE/documentation.yml index f2c34692ed9d..109e2aeb670b 100644 --- a/.github/ISSUE_TEMPLATE/documentation.yml +++ b/.github/ISSUE_TEMPLATE/documentation.yml @@ -15,7 +15,7 @@ body: id: problem attributes: label: Problem - description: What is missing, unclear, or wrong in the documentation? + description: What is missing, unclear, or wrong in the documentation? placeholder: | * I found [...] to be unclear because [...] * [...] made me think that [...] when really it should be [...] diff --git a/.github/ISSUE_TEMPLATE/maintenance.yml b/.github/ISSUE_TEMPLATE/maintenance.yml index eb2458dda6e8..746ab55ef0e3 100644 --- a/.github/ISSUE_TEMPLATE/maintenance.yml +++ b/.github/ISSUE_TEMPLATE/maintenance.yml @@ -7,11 +7,11 @@ body: id: summary attributes: label: Summary - description: Please provide 1-2 short sentences that succinctly describes what could be improved. + description: Please provide 1-2 short sentences that succinctly describes what could be improved. validations: required: true - type: textarea id: fix attributes: label: Proposed fix - description: Please describe how you think this could be improved. + description: Please describe how you think this could be improved. diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 000000000000..0b1c80159857 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,29 @@ +ci: + autofix_prs: false + autoupdate_schedule: 'quarterly' +exclude: | + (?x)^( + extern| + lib/matplotlib/mpl-data| + doc/devel/gitwash| + doc/users/prev| + doc/api/prev| + lib/matplotlib/tests/tinypages + ) +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.0.1 + hooks: + - id: check-added-large-files + - id: check-docstring-first + - id: end-of-file-fixer + exclude_types: [svg] + - id: mixed-line-ending + - id: trailing-whitespace + exclude_types: [svg] + - repo: https://github.com/pycqa/flake8 + rev: 3.9.2 + hooks: + - id: flake8 + additional_dependencies: [pydocstyle>5.1.0, flake8-docstrings>1.4.0] + args: ["--docstring-convention=all"] diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index f049ad177251..538e631e5a45 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -62,7 +62,7 @@ representative at an online or offline event. Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at matplotlib@numfocus.org (monitored by Thomas Caswell (\@tacaswell) and Hannah -Aizenman (\@story645)) or a report can be made using the [NumFOCUS Code of Conduct report form][numfocus form]. +Aizenman (\@story645)) or a report can be made using the [NumFOCUS Code of Conduct report form][numfocus form]. If community leaders cannot come to a resolution about enforcement, reports will be escalated to the NumFocus Code of Conduct committee (conduct@numfocus.org). All complaints will be reviewed and investigated promptly and fairly. diff --git a/LICENSE/LICENSE b/LICENSE/LICENSE index ec51537db27d..0752df48ef02 100644 --- a/LICENSE/LICENSE +++ b/LICENSE/LICENSE @@ -96,4 +96,4 @@ products or services of Licensee, or any third party. 8. By copying, installing or otherwise using matplotlib, Licensee agrees to be bound by the terms and conditions of this License -Agreement. \ No newline at end of file +Agreement. diff --git a/LICENSE/LICENSE_AMSFONTS b/LICENSE/LICENSE_AMSFONTS index 3627bb9bb617..71f23cb1a5fd 100644 --- a/LICENSE/LICENSE_AMSFONTS +++ b/LICENSE/LICENSE_AMSFONTS @@ -165,7 +165,7 @@ with others. The OFL allows the licensed fonts to be used, studied, modified and redistributed freely as long as they are not sold by themselves. The -fonts, including any derivative works, can be bundled, embedded, +fonts, including any derivative works, can be bundled, embedded, redistributed and/or sold with any software provided that any reserved names are not used by derivative works. The fonts and derivatives, however, cannot be released under any other type of license. The diff --git a/LICENSE/LICENSE_BAKOMA b/LICENSE/LICENSE_BAKOMA index 6200f085b9d6..b787aa11fcb7 100644 --- a/LICENSE/LICENSE_BAKOMA +++ b/LICENSE/LICENSE_BAKOMA @@ -10,22 +10,22 @@ 2) BaKoMa-AMS (1.2/19-Jan-95) AMS TeX fonts in PostScript Type 1 and TrueType font formats. - + Copyright (C) 1994, 1995, Basil K. Malyshev. All Rights Reserved. - Permission to copy and distribute these fonts for any purpose is - hereby granted without fee, provided that the above copyright notice, - author statement and this permission notice appear in all copies of + Permission to copy and distribute these fonts for any purpose is + hereby granted without fee, provided that the above copyright notice, + author statement and this permission notice appear in all copies of these fonts and related documentation. - Permission to modify and distribute modified fonts for any purpose is - hereby granted without fee, provided that the copyright notice, - author statement, this permission notice and location of original + Permission to modify and distribute modified fonts for any purpose is + hereby granted without fee, provided that the copyright notice, + author statement, this permission notice and location of original fonts (http://www.ctan.org/tex-archive/fonts/cm/ps-type1/bakoma) appear in all copies of modified fonts and related documentation. Permission to use these fonts (embedding into PostScript, PDF, SVG - and printing by using any software) is hereby granted without fee. + and printing by using any software) is hereby granted without fee. It is not required to provide any notices about using these fonts. Basil K. Malyshev @@ -37,4 +37,3 @@ E-Mail: bakoma@mail.ru or malyshev@mail.ihep.ru - diff --git a/LICENSE/LICENSE_CARLOGO b/LICENSE/LICENSE_CARLOGO index 8c99c656a0f5..856855466c15 100644 --- a/LICENSE/LICENSE_CARLOGO +++ b/LICENSE/LICENSE_CARLOGO @@ -42,4 +42,4 @@ TERMINATION This license becomes null and void if any of the above conditions are not met. DISCLAIMER -THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER DEALINGS IN THE FONT SOFTWARE. \ No newline at end of file +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER DEALINGS IN THE FONT SOFTWARE. diff --git a/LICENSE/LICENSE_COLORBREWER b/LICENSE/LICENSE_COLORBREWER index 568afe883ece..8a19d9e591f6 100644 --- a/LICENSE/LICENSE_COLORBREWER +++ b/LICENSE/LICENSE_COLORBREWER @@ -2,37 +2,37 @@ Apache-Style Software License for ColorBrewer Color Schemes Version 1.1 -Copyright (c) 2002 Cynthia Brewer, Mark Harrower, and The Pennsylvania -State University. All rights reserved. Redistribution and use in source -and binary forms, with or without modification, are permitted provided +Copyright (c) 2002 Cynthia Brewer, Mark Harrower, and The Pennsylvania +State University. All rights reserved. Redistribution and use in source +and binary forms, with or without modification, are permitted provided that the following conditions are met: -1. Redistributions as source code must retain the above copyright notice, +1. Redistributions as source code must retain the above copyright notice, this list of conditions and the following disclaimer. -2. The end-user documentation included with the redistribution, if any, -must include the following acknowledgment: "This product includes color -specifications and designs developed by Cynthia Brewer -(http://colorbrewer.org/)." Alternately, this acknowledgment may appear in -the software itself, if and wherever such third-party acknowledgments +2. The end-user documentation included with the redistribution, if any, +must include the following acknowledgment: "This product includes color +specifications and designs developed by Cynthia Brewer +(http://colorbrewer.org/)." Alternately, this acknowledgment may appear in +the software itself, if and wherever such third-party acknowledgments normally appear. -3. The name "ColorBrewer" must not be used to endorse or promote products -derived from this software without prior written permission. For written +3. The name "ColorBrewer" must not be used to endorse or promote products +derived from this software without prior written permission. For written permission, please contact Cynthia Brewer at cbrewer@psu.edu. -4. Products derived from this software may not be called "ColorBrewer", -nor may "ColorBrewer" appear in their name, without prior written +4. Products derived from this software may not be called "ColorBrewer", +nor may "ColorBrewer" appear in their name, without prior written permission of Cynthia Brewer. -THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED WARRANTIES, -INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL -CYNTHIA BREWER, MARK HARROWER, OR THE PENNSYLVANIA STATE UNIVERSITY BE -LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED WARRANTIES, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL +CYNTHIA BREWER, MARK HARROWER, OR THE PENNSYLVANIA STATE UNIVERSITY BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/LICENSE/LICENSE_COURIERTEN b/LICENSE/LICENSE_COURIERTEN index c6d3fd7410a2..fd486aa63a8d 100644 --- a/LICENSE/LICENSE_COURIERTEN +++ b/LICENSE/LICENSE_COURIERTEN @@ -15,4 +15,3 @@ is acknowledged as shown below on all unmodified copies of the 4 Charter Type 1 fonts. BITSTREAM CHARTER is a registered trademark of Bitstream Inc. - diff --git a/LICENSE/LICENSE_STIX b/LICENSE/LICENSE_STIX index 2f7aeea331ce..8ac0e29aa33e 100644 --- a/LICENSE/LICENSE_STIX +++ b/LICENSE/LICENSE_STIX @@ -1,71 +1,70 @@ TERMS AND CONDITIONS - 1. Permission is hereby granted, free of charge, to any person -obtaining a copy of the STIX Fonts-TM set accompanying this license -(collectively, the "Fonts") and the associated documentation files -(collectively with the Fonts, the "Font Software"), to reproduce and -distribute the Font Software, including the rights to use, copy, merge -and publish copies of the Font Software, and to permit persons to whom -the Font Software is furnished to do so same, subject to the following + 1. Permission is hereby granted, free of charge, to any person +obtaining a copy of the STIX Fonts-TM set accompanying this license +(collectively, the "Fonts") and the associated documentation files +(collectively with the Fonts, the "Font Software"), to reproduce and +distribute the Font Software, including the rights to use, copy, merge +and publish copies of the Font Software, and to permit persons to whom +the Font Software is furnished to do so same, subject to the following terms and conditions (the "License"). - 2. The following copyright and trademark notice and these Terms and -Conditions shall be included in all copies of one or more of the Font -typefaces and any derivative work created as permitted under this + 2. The following copyright and trademark notice and these Terms and +Conditions shall be included in all copies of one or more of the Font +typefaces and any derivative work created as permitted under this License: - Copyright (c) 2001-2005 by the STI Pub Companies, consisting of -the American Institute of Physics, the American Chemical Society, the -American Mathematical Society, the American Physical Society, Elsevier, -Inc., and The Institute of Electrical and Electronic Engineers, Inc. -Portions copyright (c) 1998-2003 by MicroPress, Inc. Portions copyright -(c) 1990 by Elsevier, Inc. All rights reserved. STIX Fonts-TM is a + Copyright (c) 2001-2005 by the STI Pub Companies, consisting of +the American Institute of Physics, the American Chemical Society, the +American Mathematical Society, the American Physical Society, Elsevier, +Inc., and The Institute of Electrical and Electronic Engineers, Inc. +Portions copyright (c) 1998-2003 by MicroPress, Inc. Portions copyright +(c) 1990 by Elsevier, Inc. All rights reserved. STIX Fonts-TM is a trademark of The Institute of Electrical and Electronics Engineers, Inc. - 3. You may (a) convert the Fonts from one format to another (e.g., -from TrueType to PostScript), in which case the normal and reasonable -distortion that occurs during such conversion shall be permitted and (b) -embed or include a subset of the Fonts in a document for the purposes of -allowing users to read text in the document that utilizes the Fonts. In -each case, you may use the STIX Fonts-TM mark to designate the resulting + 3. You may (a) convert the Fonts from one format to another (e.g., +from TrueType to PostScript), in which case the normal and reasonable +distortion that occurs during such conversion shall be permitted and (b) +embed or include a subset of the Fonts in a document for the purposes of +allowing users to read text in the document that utilizes the Fonts. In +each case, you may use the STIX Fonts-TM mark to designate the resulting Fonts or subset of the Fonts. - 4. You may also (a) add glyphs or characters to the Fonts, or modify -the shape of existing glyphs, so long as the base set of glyphs is not -removed and (b) delete glyphs or characters from the Fonts, provided -that the resulting font set is distributed with the following -disclaimer: "This [name] font does not include all the Unicode points -covered in the STIX Fonts-TM set but may include others." In each case, -the name used to denote the resulting font set shall not include the + 4. You may also (a) add glyphs or characters to the Fonts, or modify +the shape of existing glyphs, so long as the base set of glyphs is not +removed and (b) delete glyphs or characters from the Fonts, provided +that the resulting font set is distributed with the following +disclaimer: "This [name] font does not include all the Unicode points +covered in the STIX Fonts-TM set but may include others." In each case, +the name used to denote the resulting font set shall not include the term "STIX" or any similar term. - 5. You may charge a fee in connection with the distribution of the -Font Software, provided that no copy of one or more of the individual + 5. You may charge a fee in connection with the distribution of the +Font Software, provided that no copy of one or more of the individual Font typefaces that form the STIX Fonts-TM set may be sold by itself. - 6. THE FONT SOFTWARE IS PROVIDED "AS IS," WITHOUT WARRANTY OF ANY -KIND, EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, ANY WARRANTIES -OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT -OF COPYRIGHT, PATENT, TRADEMARK OR OTHER RIGHT. IN NO EVENT SHALL -MICROPRESS OR ANY OF THE STI PUB COMPANIES BE LIABLE FOR ANY CLAIM, -DAMAGES OR OTHER LIABILITY, INCLUDING, BUT NOT LIMITED TO, ANY GENERAL, -SPECIAL, INDIRECT, INCIDENTAL OR CONSEQUENTIAL DAMAGES, WHETHER IN AN -ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM OR OUT OF THE USE OR -INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER DEALINGS IN THE FONT + 6. THE FONT SOFTWARE IS PROVIDED "AS IS," WITHOUT WARRANTY OF ANY +KIND, EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, ANY WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK OR OTHER RIGHT. IN NO EVENT SHALL +MICROPRESS OR ANY OF THE STI PUB COMPANIES BE LIABLE FOR ANY CLAIM, +DAMAGES OR OTHER LIABILITY, INCLUDING, BUT NOT LIMITED TO, ANY GENERAL, +SPECIAL, INDIRECT, INCIDENTAL OR CONSEQUENTIAL DAMAGES, WHETHER IN AN +ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM OR OUT OF THE USE OR +INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER DEALINGS IN THE FONT SOFTWARE. - 7. Except as contained in the notice set forth in Section 2, the -names MicroPress Inc. and STI Pub Companies, as well as the names of the -companies/organizations that compose the STI Pub Companies, shall not be -used in advertising or otherwise to promote the sale, use or other -dealings in the Font Software without the prior written consent of the + 7. Except as contained in the notice set forth in Section 2, the +names MicroPress Inc. and STI Pub Companies, as well as the names of the +companies/organizations that compose the STI Pub Companies, shall not be +used in advertising or otherwise to promote the sale, use or other +dealings in the Font Software without the prior written consent of the respective company or organization. - 8. This License shall become null and void in the event of any + 8. This License shall become null and void in the event of any material breach of the Terms and Conditions herein by licensee. - 9. A substantial portion of the STIX Fonts set was developed by -MicroPress Inc. for the STI Pub Companies. To obtain additional -mathematical fonts, please contact MicroPress, Inc., 68-30 Harrow + 9. A substantial portion of the STIX Fonts set was developed by +MicroPress Inc. for the STI Pub Companies. To obtain additional +mathematical fonts, please contact MicroPress, Inc., 68-30 Harrow Street, Forest Hills, NY 11375, USA - Phone: (718) 575-1816. - diff --git a/README.rst b/README.rst index 744ad078a046..aabdde75ab27 100644 --- a/README.rst +++ b/README.rst @@ -115,4 +115,3 @@ For more information, please visit `the informational page `__ or download the `participant information sheet `__. - diff --git a/doc/README.txt b/doc/README.txt index a6dc1c3e6d97..0334a4ff1cdb 100644 --- a/doc/README.txt +++ b/doc/README.txt @@ -13,17 +13,17 @@ This is the top level build directory for the Matplotlib documentation. All of the documentation is written using sphinx, a python documentation system built on top of ReST. This directory contains -* users - the user documentation, e.g., installation, plotting tutorials, +* users - the user documentation, e.g., installation, plotting tutorials, configuration tips, faq, explaations, etc. * devel - documentation for Matplotlib developers * api - placeholders to automatically generate the api documentation -* tutorials, plot_types, and gallery - automatically +* tutorials, plot_types, and gallery - automatically generated by sphinx-gallery from ``../tutorials``, ``../plot_types``, and ``../examples`` respectively (these are only present if docs have been -built locally). +built locally). * thirdpartypackages - redirect to diff --git a/doc/_static/.gitignore b/doc/_static/.gitignore index bbdc34458abc..162d7163fcfb 100644 --- a/doc/_static/.gitignore +++ b/doc/_static/.gitignore @@ -2,4 +2,3 @@ contour_frontpage.png histogram_frontpage.png membrane_frontpage.png surface3d_frontpage.png - diff --git a/doc/_templates/automodule.rst b/doc/_templates/automodule.rst index e9f2a755d413..984c12e00d03 100644 --- a/doc/_templates/automodule.rst +++ b/doc/_templates/automodule.rst @@ -5,7 +5,7 @@ treat this separately (sphinx-doc/sphinx/issues/4874) .. automodule:: {{ fullname }} :members: - + {% else %} .. automodule:: {{ fullname }} @@ -18,7 +18,7 @@ Classes ------- -.. autosummary:: +.. autosummary:: :template: autosummary.rst :toctree: {% for item in classes %}{% if item not in ['zip', 'map', 'reduce'] %} @@ -32,7 +32,7 @@ Classes Functions --------- -.. autosummary:: +.. autosummary:: :template: autosummary.rst :toctree: diff --git a/doc/api/_enums_api.rst b/doc/api/_enums_api.rst index c9e283305967..c38d535f3573 100644 --- a/doc/api/_enums_api.rst +++ b/doc/api/_enums_api.rst @@ -12,4 +12,3 @@ .. autoclass:: CapStyle :members: demo :exclude-members: butt, round, projecting, input_description - diff --git a/doc/api/lines_api.rst b/doc/api/lines_api.rst index 808df726d118..4cde67c7e656 100644 --- a/doc/api/lines_api.rst +++ b/doc/api/lines_api.rst @@ -26,4 +26,3 @@ Functions :template: autosummary.rst segment_hits - \ No newline at end of file diff --git a/doc/api/next_api_changes/behavior/00001-ABC.rst b/doc/api/next_api_changes/behavior/00001-ABC.rst index 236f672c1123..d1e6fc066628 100644 --- a/doc/api/next_api_changes/behavior/00001-ABC.rst +++ b/doc/api/next_api_changes/behavior/00001-ABC.rst @@ -4,4 +4,4 @@ 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. +and ``git add`` the new file. diff --git a/doc/api/next_api_changes/development/00001-ABC.rst b/doc/api/next_api_changes/development/00001-ABC.rst index 4c60d3db185b..dba9c7b8acca 100644 --- a/doc/api/next_api_changes/development/00001-ABC.rst +++ b/doc/api/next_api_changes/development/00001-ABC.rst @@ -4,4 +4,4 @@ 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. +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 index 5c68eda9698a..f189bdeb861d 100644 --- a/doc/api/next_api_changes/removals/00001-ABC.rst +++ b/doc/api/next_api_changes/removals/00001-ABC.rst @@ -4,4 +4,4 @@ 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. +and ``git add`` the new file. diff --git a/doc/api/patches_api.rst b/doc/api/patches_api.rst index 2c016f659cba..5b1eefa91971 100644 --- a/doc/api/patches_api.rst +++ b/doc/api/patches_api.rst @@ -48,4 +48,3 @@ Functions bbox_artist draw_bbox - diff --git a/doc/api/toolkits/mplot3d/faq.rst b/doc/api/toolkits/mplot3d/faq.rst index dfc23b55e069..7e53cabc6e9a 100644 --- a/doc/api/toolkits/mplot3d/faq.rst +++ b/doc/api/toolkits/mplot3d/faq.rst @@ -49,4 +49,3 @@ Work is being done to eliminate this issue. For matplotlib v1.1.0, there is a semi-official manner to modify these parameters. See the note in the :mod:`.mplot3d.axis3d` section of the mplot3d API documentation for more information. - diff --git a/doc/api/transformations.rst b/doc/api/transformations.rst index 25d959801c28..186db9aea728 100644 --- a/doc/api/transformations.rst +++ b/doc/api/transformations.rst @@ -15,4 +15,3 @@ interval_contains, interval_contains_open :show-inheritance: :special-members: - diff --git a/doc/api/tri_api.rst b/doc/api/tri_api.rst index 9205e34ff93b..fdf123c03908 100644 --- a/doc/api/tri_api.rst +++ b/doc/api/tri_api.rst @@ -17,7 +17,7 @@ :show-inheritance: .. autoclass:: matplotlib.tri.TriInterpolator - + .. autoclass:: matplotlib.tri.LinearTriInterpolator :members: __call__, gradient :show-inheritance: @@ -30,7 +30,7 @@ .. autoclass:: matplotlib.tri.UniformTriRefiner :show-inheritance: - :members: + :members: .. autoclass:: matplotlib.tri.TriAnalyzer - :members: + :members: diff --git a/doc/devel/contributing.rst b/doc/devel/contributing.rst index d20c23306243..90c97f626780 100644 --- a/doc/devel/contributing.rst +++ b/doc/devel/contributing.rst @@ -40,15 +40,15 @@ difficulty. ``Difficulty: Easy`` is suited for people with little Python experie ``Difficulty: Medium`` and ``Difficulty: Hard`` are not trivial to solve and require more thought and programming experience. -In general, the Matplotlib project does not assign issues. Issues are -"assigned" or "claimed" by opening a PR; there is no other assignment -mechanism. If you have opened such a PR, please comment on the issue thread to -avoid duplication of work. Please check if there is an existing PR for the -issue you are addressing. If there is, try to work with the author by -submitting reviews of their code or commenting on the PR rather than opening -a new PR; duplicate PRs are subject to being closed. However, if the existing -PR is an outline, unlikely to work, or stalled, and the original author is -unresponsive, feel free to open a new PR referencing the old one. +In general, the Matplotlib project does not assign issues. Issues are +"assigned" or "claimed" by opening a PR; there is no other assignment +mechanism. If you have opened such a PR, please comment on the issue thread to +avoid duplication of work. Please check if there is an existing PR for the +issue you are addressing. If there is, try to work with the author by +submitting reviews of their code or commenting on the PR rather than opening +a new PR; duplicate PRs are subject to being closed. However, if the existing +PR is an outline, unlikely to work, or stalled, and the original author is +unresponsive, feel free to open a new PR referencing the old one. .. _submitting-a-bug-report: diff --git a/doc/devel/development_setup.rst b/doc/devel/development_setup.rst index 468a7add7d75..c6aac3f1c467 100644 --- a/doc/devel/development_setup.rst +++ b/doc/devel/development_setup.rst @@ -60,6 +60,16 @@ true for ``*.py`` files. If you change the C-extension source (which might also happen if you change branches) you will have to re-run ``python -m pip install -ve .`` +Installing pre-commit hooks +=========================== +You can optionally install `pre-commit `_ hooks. +These will automatically check flake8 and other style issues when you run +``git commit``. The hooks are defined in the top level +``.pre-commit-config.yaml`` file. To install the hooks :: + + pip install pre-commit + pre-commit install + Installing additional dependencies for development ================================================== See :ref:`development-dependencies`. diff --git a/doc/devel/documenting_mpl.rst b/doc/devel/documenting_mpl.rst index c1f2fd26c7cf..c2ac9ec3a994 100644 --- a/doc/devel/documenting_mpl.rst +++ b/doc/devel/documenting_mpl.rst @@ -10,34 +10,34 @@ Getting started General file structure ---------------------- -All documentation is built from the :file:`doc/`. The :file:`doc/` -directory contains configuration files for Sphinx and reStructuredText +All documentation is built from the :file:`doc/`. The :file:`doc/` +directory contains configuration files for Sphinx and reStructuredText (ReST_; ``.rst``) files that are rendered to documentation pages. -Documentation is created in three ways. First, API documentation +Documentation is created in three ways. First, API documentation (:file:`doc/api`) is created by Sphinx_ from the docstrings of the classes in the Matplotlib library. Except for -:file:`doc/api/api_changes/`, ``.rst`` files in :file:`doc/api` are created +:file:`doc/api/api_changes/`, ``.rst`` files in :file:`doc/api` are created when the documentation is built. See :ref:`writing-docstrings` below. -Second, the contents of :file:`doc/plot_types`, :file:`doc/gallery` and -:file:`doc/tutorials` are generated by the `Sphinx Gallery`_ from python -files in :file:`plot_types/`, :file:`examples/` and :file:`tutorials/`. -These sources consist of python scripts that have ReST_ documentation built -into their comments. See :ref:`writing-examples-and-tutorials` below. +Second, the contents of :file:`doc/plot_types`, :file:`doc/gallery` and +:file:`doc/tutorials` are generated by the `Sphinx Gallery`_ from python +files in :file:`plot_types/`, :file:`examples/` and :file:`tutorials/`. +These sources consist of python scripts that have ReST_ documentation built +into their comments. See :ref:`writing-examples-and-tutorials` below. -Third, Matplotlib has narrative docs written in ReST_ in subdirectories of -:file:`doc/users/`. If you would like to add new documentation that is suited -to an ``.rst`` file rather than a gallery or tutorial example, choose an -appropriate subdirectory to put it in, and add the file to the table of -contents of :file:`index.rst` of the subdirectory. See -:ref:`writing-rest-pages` below. +Third, Matplotlib has narrative docs written in ReST_ in subdirectories of +:file:`doc/users/`. If you would like to add new documentation that is suited +to an ``.rst`` file rather than a gallery or tutorial example, choose an +appropriate subdirectory to put it in, and add the file to the table of +contents of :file:`index.rst` of the subdirectory. See +:ref:`writing-rest-pages` below. .. note:: Don't directly edit the ``.rst`` files in :file:`doc/plot_types`, - :file:`doc/gallery`, :file:`doc/tutorials`, and :file:`doc/api` - (excepting :file:`doc/api/api_changes/`). Sphinx_ regenerates + :file:`doc/gallery`, :file:`doc/tutorials`, and :file:`doc/api` + (excepting :file:`doc/api/api_changes/`). Sphinx_ regenerates files in these directories when building documentation. Setting up the doc build @@ -1022,10 +1022,10 @@ Example: Navbar and style ---------------- -Matplotlib has a few subprojects that share the same navbar and style, so these +Matplotlib has a few subprojects that share the same navbar and style, so these are centralized as a sphinx theme at -`mpl_sphinx_theme `_. Changes to the -style or topbar should be made there to propagate across all subprojects. +`mpl_sphinx_theme `_. Changes to the +style or topbar should be made there to propagate across all subprojects. .. TODO: Add section about uploading docs diff --git a/doc/devel/style_guide.rst b/doc/devel/style_guide.rst index 65779e18a734..342875674602 100644 --- a/doc/devel/style_guide.rst +++ b/doc/devel/style_guide.rst @@ -406,4 +406,3 @@ resources contain common best practices for writing documentation. * `Google Developer Style Guide `_ * `IBM Style Guide `_ * `Red Hat Style Guide `_ - diff --git a/doc/devel/testing.rst b/doc/devel/testing.rst index 65898b95ee0c..d56c67266d0e 100644 --- a/doc/devel/testing.rst +++ b/doc/devel/testing.rst @@ -256,4 +256,3 @@ The test discovery scope can be narrowed to single test modules or even single functions:: python -m pytest --pyargs matplotlib.tests.test_simplification.py::test_clipping - diff --git a/doc/users/explain/fonts.rst b/doc/users/explain/fonts.rst index 9bf2bbc26a2d..8a69dca7feeb 100644 --- a/doc/users/explain/fonts.rst +++ b/doc/users/explain/fonts.rst @@ -1,5 +1,5 @@ .. redirect-from:: /users/fonts - + Fonts in Matplotlib text engine =============================== diff --git a/doc/users/faq/index.rst b/doc/users/faq/index.rst index 124b1a7f561a..636c90904aba 100644 --- a/doc/users/faq/index.rst +++ b/doc/users/faq/index.rst @@ -3,7 +3,7 @@ .. redirect-from:: /faq/index ########################## -How-to and troubleshooting +How-to and troubleshooting ########################## .. only:: html diff --git a/doc/users/getting_started/index.rst b/doc/users/getting_started/index.rst index 8ce5491ce19e..0a741dbbdd39 100644 --- a/doc/users/getting_started/index.rst +++ b/doc/users/getting_started/index.rst @@ -44,7 +44,7 @@ Here is a minimal example plot: ax.plot(x, y) plt.show() -If a plot does not show up please check :ref:`troubleshooting-faq`. +If a plot does not show up please check :ref:`troubleshooting-faq`. Where to go next ---------------- diff --git a/doc/users/index.rst b/doc/users/index.rst index e065df00164b..17c67825971b 100644 --- a/doc/users/index.rst +++ b/doc/users/index.rst @@ -29,7 +29,7 @@ General faq/index.rst resources/index.rst -Reference +Reference ######### .. toctree:: diff --git a/doc/users/next_whats_new/extending_MarkerStyle.rst b/doc/users/next_whats_new/extending_MarkerStyle.rst index 6e970d0738fe..f31585a70b1c 100644 --- a/doc/users/next_whats_new/extending_MarkerStyle.rst +++ b/doc/users/next_whats_new/extending_MarkerStyle.rst @@ -6,7 +6,7 @@ the user to supply a transformation to be applied to the marker (e.g. a rotation .. plot:: :include-source: true - + import matplotlib.pyplot as plt from matplotlib.markers import MarkerStyle from matplotlib.transforms import Affine2D diff --git a/doc/users/resources/index.rst b/doc/users/resources/index.rst index bd83759766fb..0591aae5bb65 100644 --- a/doc/users/resources/index.rst +++ b/doc/users/resources/index.rst @@ -70,7 +70,7 @@ Tutorials * `The Python Graph Gallery `_ by Yan Holtz - + * `Matplotlib tutorial `_ by Nicolas P. Rougier diff --git a/environment.yml b/environment.yml index d73d7a99f579..c75cf4a40733 100644 --- a/environment.yml +++ b/environment.yml @@ -48,6 +48,7 @@ dependencies: - nbformat!=5.0.0,!=5.0.1 - pandas!=0.25.0 - pikepdf + - pre-commit - pydocstyle>=5.1.0 - pytest!=4.6.0,!=5.4.0 - pytest-cov diff --git a/examples/event_handling/README.txt b/examples/event_handling/README.txt index a4c4b6524658..46aed29b56bc 100644 --- a/examples/event_handling/README.txt +++ b/examples/event_handling/README.txt @@ -3,11 +3,11 @@ Event handling ============== -Matplotlib supports :doc:`event handling` with -a GUI neutral event model, so you can connect to Matplotlib events without -knowledge of what user interface Matplotlib will ultimately be plugged in to. -This has two advantages: the code you write will be more portable, and -Matplotlib events are aware of things like data coordinate space and which -axes the event occurs in so you don't have to mess with low level -transformation details to go from canvas space to data space. Object picking +Matplotlib supports :doc:`event handling` with +a GUI neutral event model, so you can connect to Matplotlib events without +knowledge of what user interface Matplotlib will ultimately be plugged in to. +This has two advantages: the code you write will be more portable, and +Matplotlib events are aware of things like data coordinate space and which +axes the event occurs in so you don't have to mess with low level +transformation details to go from canvas space to data space. Object picking examples are also included. diff --git a/examples/images_contours_and_fields/colormap_normalizations_symlognorm.py b/examples/images_contours_and_fields/colormap_normalizations_symlognorm.py index 7856068fd1d8..1746eaaf0de0 100644 --- a/examples/images_contours_and_fields/colormap_normalizations_symlognorm.py +++ b/examples/images_contours_and_fields/colormap_normalizations_symlognorm.py @@ -5,6 +5,11 @@ Demonstration of using norm to map colormaps onto data in non-linear ways. +Here we plot data that has two humps, one negative and one positive. +The positive hump has 5-times the amplitude of the negative. +With a linear scale you cannot see detail in the negative hump. +So we logarithmically scale the positive and negative data separately. + .. redirect-from:: /gallery/userdemo/colormap_normalization_symlognorm """ @@ -12,14 +17,6 @@ import matplotlib.pyplot as plt import matplotlib.colors as colors -""" -SymLogNorm: two humps, one negative and one positive, The positive -with 5-times the amplitude. Linearly, you cannot see detail in the -negative hump. Here we logarithmically scale the positive and -negative data separately. - -Note that colorbar labels do not come out looking very good. -""" N = 100 X, Y = np.mgrid[-3:3:complex(0, N), -2:2:complex(0, N)] diff --git a/lib/matplotlib/_constrained_layout.py b/lib/matplotlib/_constrained_layout.py index 457e0fbf2935..8032156350d9 100644 --- a/lib/matplotlib/_constrained_layout.py +++ b/lib/matplotlib/_constrained_layout.py @@ -24,44 +24,42 @@ _log = logging.getLogger(__name__) -""" -General idea: -------------- - -First, a figure has a gridspec that divides the figure into nrows and ncols, -with heights and widths set by ``height_ratios`` and ``width_ratios``, -often just set to 1 for an equal grid. - -Subplotspecs that are derived from this gridspec can contain either a -``SubPanel``, a ``GridSpecFromSubplotSpec``, or an axes. The ``SubPanel`` and -``GridSpecFromSubplotSpec`` are dealt with recursively and each contain an -analogous layout. - -Each ``GridSpec`` has a ``_layoutgrid`` attached to it. The ``_layoutgrid`` -has the same logical layout as the ``GridSpec``. Each row of the grid spec -has a top and bottom "margin" and each column has a left and right "margin". -The "inner" height of each row is constrained to be the same (or as modified -by ``height_ratio``), and the "inner" width of each column is -constrained to be the same (as modified by ``width_ratio``), where "inner" -is the width or height of each column/row minus the size of the margins. - -Then the size of the margins for each row and column are determined as the -max width of the decorators on each axes that has decorators in that margin. -For instance, a normal axes would have a left margin that includes the -left ticklabels, and the ylabel if it exists. The right margin may include a -colorbar, the bottom margin the xaxis decorations, and the top margin the -title. - -With these constraints, the solver then finds appropriate bounds for the -columns and rows. It's possible that the margins take up the whole figure, -in which case the algorithm is not applied and a warning is raised. - -See the tutorial doc:`/tutorials/intermediate/constrainedlayout_guide` -for more discussion of the algorithm with examples. -""" +# ############################################################################# +# General idea: +# ------------- +# +# First, a figure has a gridspec that divides the figure into nrows and ncols, +# with heights and widths set by ``height_ratios`` and ``width_ratios``, +# often just set to 1 for an equal grid. +# +# Subplotspecs that are derived from this gridspec can contain either a +# ``SubPanel``, a ``GridSpecFromSubplotSpec``, or an axes. The ``SubPanel`` +# and ``GridSpecFromSubplotSpec`` are dealt with recursively and each contain +# an analogous layout. +# +# Each ``GridSpec`` has a ``_layoutgrid`` attached to it. The ``_layoutgrid`` +# has the same logical layout as the ``GridSpec``. Each row of the grid spec +# has a top and bottom "margin" and each column has a left and right "margin". +# The "inner" height of each row is constrained to be the same (or as modified +# by ``height_ratio``), and the "inner" width of each column is +# constrained to be the same (as modified by ``width_ratio``), where "inner" +# is the width or height of each column/row minus the size of the margins. +# +# Then the size of the margins for each row and column are determined as the +# max width of the decorators on each axes that has decorators in that margin. +# For instance, a normal axes would have a left margin that includes the +# left ticklabels, and the ylabel if it exists. The right margin may include a +# colorbar, the bottom margin the xaxis decorations, and the top margin the +# title. +# +# With these constraints, the solver then finds appropriate bounds for the +# columns and rows. It's possible that the margins take up the whole figure, +# in which case the algorithm is not applied and a warning is raised. +# +# See the tutorial doc:`/tutorials/intermediate/constrainedlayout_guide` +# for more discussion of the algorithm with examples. -###################################################### def do_constrained_layout(fig, renderer, h_pad, w_pad, hspace=None, wspace=None): """ diff --git a/lib/matplotlib/backend_tools.py b/lib/matplotlib/backend_tools.py index 0c25ad554b26..658e4539624e 100644 --- a/lib/matplotlib/backend_tools.py +++ b/lib/matplotlib/backend_tools.py @@ -989,12 +989,10 @@ def trigger(self, *args, **kwargs): 'help': ToolHelpBase, 'copy': ToolCopyToClipboardBase, } -"""Default tools""" default_toolbar_tools = [['navigation', ['home', 'back', 'forward']], ['zoompan', ['pan', 'zoom', 'subplots']], ['io', ['save', 'help']]] -"""Default tools in the toolbar""" def add_tools_to_manager(toolmanager, tools=default_tools): diff --git a/lib/matplotlib/backends/web_backend/css/fbm.css b/lib/matplotlib/backends/web_backend/css/fbm.css index 4c6236fb58c7..ce35d99a5e64 100644 --- a/lib/matplotlib/backends/web_backend/css/fbm.css +++ b/lib/matplotlib/backends/web_backend/css/fbm.css @@ -1,95 +1,95 @@ /* Flexible box model classes */ /* Taken from Alex Russell https://infrequently.org/2009/08/css-3-progress/ */ - + .hbox { display: -webkit-box; -webkit-box-orient: horizontal; -webkit-box-align: stretch; - + display: -moz-box; -moz-box-orient: horizontal; -moz-box-align: stretch; - + display: box; box-orient: horizontal; box-align: stretch; } - + .hbox > * { -webkit-box-flex: 0; -moz-box-flex: 0; box-flex: 0; } - + .vbox { display: -webkit-box; -webkit-box-orient: vertical; -webkit-box-align: stretch; - + display: -moz-box; -moz-box-orient: vertical; -moz-box-align: stretch; - + display: box; box-orient: vertical; box-align: stretch; } - + .vbox > * { -webkit-box-flex: 0; -moz-box-flex: 0; box-flex: 0; } - + .reverse { -webkit-box-direction: reverse; -moz-box-direction: reverse; box-direction: reverse; } - + .box-flex0 { -webkit-box-flex: 0; -moz-box-flex: 0; box-flex: 0; } - + .box-flex1, .box-flex { -webkit-box-flex: 1; -moz-box-flex: 1; box-flex: 1; } - + .box-flex2 { -webkit-box-flex: 2; -moz-box-flex: 2; box-flex: 2; } - + .box-group1 { -webkit-box-flex-group: 1; -moz-box-flex-group: 1; box-flex-group: 1; } - + .box-group2 { -webkit-box-flex-group: 2; -moz-box-flex-group: 2; box-flex-group: 2; } - + .start { -webkit-box-pack: start; -moz-box-pack: start; box-pack: start; } - + .end { -webkit-box-pack: end; -moz-box-pack: end; box-pack: end; } - + .center { -webkit-box-pack: center; -moz-box-pack: center; diff --git a/lib/matplotlib/backends/web_backend/css/page.css b/lib/matplotlib/backends/web_backend/css/page.css index c380ef0a3ffc..ded0d9220379 100644 --- a/lib/matplotlib/backends/web_backend/css/page.css +++ b/lib/matplotlib/backends/web_backend/css/page.css @@ -80,4 +80,3 @@ span#login_widget { margin: 10px; vertical-align: top; } - diff --git a/lib/matplotlib/dates.py b/lib/matplotlib/dates.py index 69f5890629b1..c5fec1254e83 100644 --- a/lib/matplotlib/dates.py +++ b/lib/matplotlib/dates.py @@ -210,9 +210,8 @@ def _get_rc_timezone(): return dateutil.tz.gettz(s) -""" -Time-related constants. -""" +# Time-related constants. + EPOCH_OFFSET = float(datetime.datetime(1970, 1, 1).toordinal()) # EPOCH_OFFSET is not used by matplotlib JULIAN_OFFSET = 1721424.5 # Julian date at 0000-12-31 diff --git a/lib/matplotlib/tests/README b/lib/matplotlib/tests/README index 4d8f6e3c30d2..0613afcc85a3 100644 --- a/lib/matplotlib/tests/README +++ b/lib/matplotlib/tests/README @@ -6,4 +6,3 @@ the Testing section of the Matplotlib Developers’ Guide: * https://matplotlib.org/devel/testing.html * /doc/devel/coding_guide.rst (equivalent, but in reST format) - diff --git a/plot_types/README.rst b/plot_types/README.rst index d93d73e7b246..885c010b6fdc 100644 --- a/plot_types/README.rst +++ b/plot_types/README.rst @@ -5,6 +5,6 @@ Plot types Overview of many common plotting commands in Matplotlib. -Note that we have stripped all labels, but they are present by default. -See the `gallery <../gallery/index.html>`_ for many more examples and -the `tutorials page <../tutorials/index.html>`_ for longer examples. \ No newline at end of file +Note that we have stripped all labels, but they are present by default. +See the `gallery <../gallery/index.html>`_ for many more examples and +the `tutorials page <../tutorials/index.html>`_ for longer examples. diff --git a/plot_types/arrays/README.rst b/plot_types/arrays/README.rst index 1e9c2590c36e..43844ee9490c 100644 --- a/plot_types/arrays/README.rst +++ b/plot_types/arrays/README.rst @@ -3,4 +3,4 @@ Plots of arrays and fields -------------------------- -Plotting for arrays of data ``Z(x, y)`` and fields ``U(x, y), V(x, y)``. \ No newline at end of file +Plotting for arrays of data ``Z(x, y)`` and fields ``U(x, y), V(x, y)``. diff --git a/plot_types/basic/README.rst b/plot_types/basic/README.rst index 7ad8b4692ec6..9ce35d083177 100644 --- a/plot_types/basic/README.rst +++ b/plot_types/basic/README.rst @@ -3,4 +3,4 @@ Basic ----- -Basic plot types, usually y versus x. \ No newline at end of file +Basic plot types, usually y versus x. diff --git a/plot_types/stats/README.rst b/plot_types/stats/README.rst index 9944c77acccc..b2ca855aafbc 100644 --- a/plot_types/stats/README.rst +++ b/plot_types/stats/README.rst @@ -3,4 +3,4 @@ Statistics plots ---------------- -Plots for statistical analysis. \ No newline at end of file +Plots for statistical analysis. diff --git a/plot_types/unstructured/README.rst b/plot_types/unstructured/README.rst index 0f0a04d28913..89b7844775d2 100644 --- a/plot_types/unstructured/README.rst +++ b/plot_types/unstructured/README.rst @@ -4,6 +4,6 @@ Unstructured coordinates ------------------------- Sometimes we collect data ``z`` at coordinates ``(x,y)`` and want to visualize -as a contour. Instead of gridding the data and then using -`~.axes.Axes.contour`, we can use a triangulation algorithm and fill the -triangles. \ No newline at end of file +as a contour. Instead of gridding the data and then using +`~.axes.Axes.contour`, we can use a triangulation algorithm and fill the +triangles. diff --git a/src/_backend_agg.h b/src/_backend_agg.h index 0cd76618e26d..8f175b18f0bf 100644 --- a/src/_backend_agg.h +++ b/src/_backend_agg.h @@ -43,7 +43,7 @@ /**********************************************************************/ -// a helper class to pass agg::buffer objects around. +// a helper class to pass agg::buffer objects around. class BufferRegion { diff --git a/src/_path.h b/src/_path.h index f4c8fd036d2c..5134f833c28d 100644 --- a/src/_path.h +++ b/src/_path.h @@ -852,7 +852,7 @@ inline bool segments_intersect(const double &x1, else { return (fmin(x1, x2) <= fmin(x3, x4) && fmin(x3, x4) <= fmax(x1, x2)) || (fmin(x3, x4) <= fmin(x1, x2) && fmin(x1, x2) <= fmax(x3, x4)); - + } } // 2 - If t_area is not zero, the segments are parallel, but not collinear @@ -876,7 +876,7 @@ inline bool segments_intersect(const double &x1, template bool path_intersects_path(PathIterator1 &p1, PathIterator2 &p2) { - + typedef PathNanRemover no_nans_t; typedef agg::conv_curve curve_t; @@ -901,7 +901,7 @@ bool path_intersects_path(PathIterator1 &p1, PathIterator2 &p2) } c2.rewind(0); c2.vertex(&x21, &y21); - + while (c2.vertex(&x22, &y22) != agg::path_cmd_stop) { // if the segment in path 2 is (almost) 0 length, skip to next vertex