diff --git a/doc/api/artist_api.rst b/doc/api/artist_api.rst index b635ed3bd0ba..ca2207e15dca 100644 --- a/doc/api/artist_api.rst +++ b/doc/api/artist_api.rst @@ -27,6 +27,7 @@ Interactive ----------- .. autosummary:: + :template: autosummary.rst :toctree: _as_gen :nosignatures: @@ -48,6 +49,7 @@ Clipping -------- .. autosummary:: + :template: autosummary.rst :toctree: _as_gen :nosignatures: @@ -62,6 +64,7 @@ Bulk Properties --------------- .. autosummary:: + :template: autosummary.rst :toctree: _as_gen :nosignatures: @@ -74,6 +77,7 @@ Drawing ------- .. autosummary:: + :template: autosummary.rst :toctree: _as_gen :nosignatures: @@ -107,6 +111,7 @@ Figure and Axes --------------- .. autosummary:: + :template: autosummary.rst :toctree: _as_gen :nosignatures: @@ -121,6 +126,7 @@ Children -------- .. autosummary:: + :template: autosummary.rst :toctree: _as_gen :nosignatures: @@ -131,6 +137,7 @@ Transform --------- .. autosummary:: + :template: autosummary.rst :toctree: _as_gen :nosignatures: @@ -142,6 +149,7 @@ Units ----- .. autosummary:: + :template: autosummary.rst :toctree: _as_gen :nosignatures: @@ -153,6 +161,7 @@ Metadata -------- .. autosummary:: + :template: autosummary.rst :toctree: _as_gen :nosignatures: @@ -167,6 +176,7 @@ Miscellaneous ------------- .. autosummary:: + :template: autosummary.rst :toctree: _as_gen :nosignatures: @@ -179,6 +189,7 @@ Functions ========= .. autosummary:: + :template: autosummary.rst :toctree: _as_gen :nosignatures: diff --git a/doc/users/installing/index.rst b/doc/users/installing/index.rst index 9641575d5046..1b6fdf65055f 100644 --- a/doc/users/installing/index.rst +++ b/doc/users/installing/index.rst @@ -304,9 +304,9 @@ at the Terminal.app command line:: You should see something like :: - 3.0.0 /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/matplotlib/__init__.py + 3.6.0 /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/matplotlib/__init__.py -where ``3.0.0`` is the Matplotlib version you just installed, and the path +where ``3.6.0`` is the Matplotlib version you just installed, and the path following depends on whether you are using Python.org Python, Homebrew or Macports. If you see another version, or you get an error like :: diff --git a/examples/lines_bars_and_markers/linestyles.py b/examples/lines_bars_and_markers/linestyles.py index 88a363898da8..3e30f49acce1 100644 --- a/examples/lines_bars_and_markers/linestyles.py +++ b/examples/lines_bars_and_markers/linestyles.py @@ -6,8 +6,9 @@ Simple linestyles can be defined using the strings "solid", "dotted", "dashed" or "dashdot". More refined control can be achieved by providing a dash tuple ``(offset, (on_off_seq))``. For example, ``(0, (3, 10, 1, 15))`` means -(3pt line, 10pt space, 1pt line, 15pt space) with no offset. See also -`.Line2D.set_linestyle`. +(3pt line, 10pt space, 1pt line, 15pt space) with no offset, while +``(5, (10, 3))``, means (10pt line, 3pt space), but skip the first 5pt line. +See also `.Line2D.set_linestyle`. *Note*: The dash style can also be configured via `.Line2D.set_dashes` as shown in :doc:`/gallery/lines_bars_and_markers/line_demo_dash_control` @@ -27,7 +28,7 @@ ('loosely dotted', (0, (1, 10))), ('dotted', (0, (1, 1))), ('densely dotted', (0, (1, 1))), - + ('long dash with offset', (5, (10, 3))), ('loosely dashed', (0, (5, 10))), ('dashed', (0, (5, 5))), ('densely dashed', (0, (5, 1))), diff --git a/examples/ticks/centered_ticklabels.py b/examples/ticks/centered_ticklabels.py index 61431e3ab21c..34ab9e8b9083 100644 --- a/examples/ticks/centered_ticklabels.py +++ b/examples/ticks/centered_ticklabels.py @@ -7,7 +7,7 @@ 'center', 'left', or 'right' can be controlled using the horizontal alignment property:: - for label in ax.xaxis.get_xticklabels(): + for label in ax.get_xticklabels(): label.set_horizontalalignment('right') However there is no direct way to center the labels between ticks. To fake @@ -23,7 +23,7 @@ import matplotlib.ticker as ticker import matplotlib.pyplot as plt -# load some financial data; Google's stock price +# Load some financial data; Google's stock price r = (cbook.get_sample_data('goog.npz', np_load=True)['price_data'] .view(np.recarray)) r = r[-250:] # get the last 250 days @@ -38,11 +38,12 @@ ax.xaxis.set_major_formatter(ticker.NullFormatter()) ax.xaxis.set_minor_formatter(dates.DateFormatter('%b')) -for tick in ax.xaxis.get_minor_ticks(): - tick.tick1line.set_markersize(0) - tick.tick2line.set_markersize(0) - tick.label1.set_horizontalalignment('center') +# Remove the tick lines +ax.tick_params(axis='x', which='minor', tick1On=False, tick2On=False) +# Align the minor tick label +for label in ax.get_xticklabels(minor=True): + label.set_horizontalalignment('center') imid = len(r) // 2 ax.set_xlabel(str(r.date[imid].item().year)) plt.show() diff --git a/lib/matplotlib/mpl-data/matplotlibrc b/lib/matplotlib/mpl-data/matplotlibrc index c0c7e42f6c8f..e65e3c209030 100644 --- a/lib/matplotlib/mpl-data/matplotlibrc +++ b/lib/matplotlib/mpl-data/matplotlibrc @@ -19,7 +19,7 @@ ## $HOME/.matplotlib/matplotlibrc ## and edit that copy. ## -## See https://matplotlib.org/users/customizing.html#the-matplotlibrc-file +## See https://matplotlib.org/stable/tutorials/introductory/customizing.html#customizing-with-matplotlibrc-files ## for more details on the paths which are checked for the configuration file. ## ## Blank lines, or lines starting with a comment symbol, are ignored, as are @@ -218,9 +218,9 @@ ## on font properties. The 6 font properties used for font matching are ## given below with their default values. ## -## The font.family property can take either a concrete font name (not supported -## when rendering text with usetex), or one of the following five generic -## values: +## The font.family property can take either a single or multiple entries of any +## combination of concrete font names (not supported when rendering text with +## usetex) or the following five generic values: ## - 'serif' (e.g., Times), ## - 'sans-serif' (e.g., Helvetica), ## - 'cursive' (e.g., Zapf-Chancery), @@ -738,9 +738,10 @@ ## * INTERACTIVE KEYMAPS * ## *************************************************************************** ## Event keys to interact with figures/plots via keyboard. -## See https://matplotlib.org/users/navigation_toolbar.html for more details on -## interactive navigation. Customize these settings according to your needs. -## Leave the field(s) empty if you don't need a key-map. (i.e., fullscreen : '') +## See https://matplotlib.org/stable/users/explain/interactive.html for more +## details on interactive navigation. Customize these settings according to +## your needs. Leave the field(s) empty if you don't need a key-map. (i.e., +## fullscreen : '') #keymap.fullscreen: f, ctrl+f # toggling #keymap.home: h, r, home # home or reset mnemonic #keymap.back: left, c, backspace, MouseButton.BACK # forward / backward keys diff --git a/lib/matplotlib/tri/triangulation.py b/lib/matplotlib/tri/triangulation.py index 53a63520ca74..00d8da4f4d28 100644 --- a/lib/matplotlib/tri/triangulation.py +++ b/lib/matplotlib/tri/triangulation.py @@ -104,7 +104,7 @@ def edges(self): Return integer array of shape (nedges, 2) containing all edges of non-masked triangles. - Each row defines an edge by it's start point index and end point + Each row defines an edge by its start point index and end point index. Each edge appears only once, i.e. for an edge between points *i* and *j*, there will only be either *(i, j)* or *(j, i)*. """ @@ -126,7 +126,7 @@ def get_cpp_triangulation(self): def get_masked_triangles(self): """ - Return an array of triangles that are not masked. + Return an array of triangles taking the mask into account. """ if self.mask is not None: return self.triangles[~self.mask] diff --git a/lib/matplotlib/tri/tricontour.py b/lib/matplotlib/tri/tricontour.py index 8e2f66f4f78c..df3b44d941ef 100644 --- a/lib/matplotlib/tri/tricontour.py +++ b/lib/matplotlib/tri/tricontour.py @@ -129,7 +129,7 @@ def _contour_args(self, args, kwargs): The colors of the levels, i.e., the contour %%(type)s. The sequence is cycled for the levels in ascending order. If the sequence - is shorter than the number of levels, it's repeated. + is shorter than the number of levels, it is repeated. As a shortcut, single color strings may be used in place of one-element lists, i.e. ``'red'`` instead of ``['red']`` to color all levels with the diff --git a/setup.py b/setup.py index 53131df5bb6b..b7f9b98c12e8 100644 --- a/setup.py +++ b/setup.py @@ -263,7 +263,7 @@ def make_release_tree(self, base_dir, files): author="John D. Hunter, Michael Droettboom", author_email="matplotlib-users@python.org", url="https://matplotlib.org", - download_url="https://matplotlib.org/users/installing.html", + download_url="https://matplotlib.org/stable/users/installing/index.html", project_urls={ 'Documentation': 'https://matplotlib.org', 'Source Code': 'https://github.com/matplotlib/matplotlib', diff --git a/tutorials/intermediate/artists.py b/tutorials/intermediate/artists.py index 16c4566071f2..f76c62d8462c 100644 --- a/tutorials/intermediate/artists.py +++ b/tutorials/intermediate/artists.py @@ -353,7 +353,7 @@ class in the Matplotlib API, and the one you will be working with most # images A list of `.FigureImage` patches - # useful for raw pixel display # legends A list of Figure `.Legend` instances -# (different from ``Axes.legends``) +# (different from ``Axes.get_legend()``) # lines A list of Figure `.Line2D` instances # (rarely used, see ``Axes.lines``) # patches A list of Figure `.Patch`\s @@ -543,7 +543,7 @@ class in the Matplotlib API, and the one you will be working with most # `~.axes.Axes.fill` - shared area `.Polygon` ax.patches # `~.axes.Axes.hist` - histograms `.Rectangle` ax.patches # `~.axes.Axes.imshow` - image data `.AxesImage` ax.images -# `~.axes.Axes.legend` - Axes legends `.Legend` ax.legends +# `~.axes.Axes.legend` - Axes legend `.Legend` ax.get_legend() # `~.axes.Axes.plot` - xy plots `.Line2D` ax.lines # `~.axes.Axes.scatter` - scatter charts `.PolyCollection` ax.collections # `~.axes.Axes.text` - text `.Text` ax.texts @@ -563,26 +563,26 @@ class in the Matplotlib API, and the one you will be working with most # the font color of the ``XAxis`` ticklabels using the ``Axes`` helper # method:: # -# for label in ax.get_xticklabels(): -# label.set_color('orange') +# ax.tick_params(axis='x', labelcolor='orange') # -# Below is a summary of the Artists that the Axes contains +# Below is a summary of the Artists that the `~.axes.Axes` contains # # ============== ========================================= # Axes attribute Description # ============== ========================================= -# artists A list of `.Artist` instances +# artists An `.ArtistList` of `.Artist` instances # patch `.Rectangle` instance for Axes background -# collections A list of `.Collection` instances -# images A list of `.AxesImage` -# legends A list of `.Legend` instances -# lines A list of `.Line2D` instances -# patches A list of `.Patch` instances -# texts A list of `.Text` instances +# collections An `.ArtistList` of `.Collection` instances +# images An `.ArtistList` of `.AxesImage` +# lines An `.ArtistList` of `.Line2D` instances +# patches An `.ArtistList` of `.Patch` instances +# texts An `.ArtistList` of `.Text` instances # xaxis A `matplotlib.axis.XAxis` instance # yaxis A `matplotlib.axis.YAxis` instance # ============== ========================================= # +# The legend can be accessed by `~.axes.Axes.get_legend`, +# # .. _axis-container: # # Axis containers diff --git a/tutorials/introductory/customizing.py b/tutorials/introductory/customizing.py index 9e74016c823e..ea6b501e99ea 100644 --- a/tutorials/introductory/customizing.py +++ b/tutorials/introductory/customizing.py @@ -217,8 +217,8 @@ def plotting_function(): # # 4. :file:`{INSTALL}/matplotlib/mpl-data/matplotlibrc`, where # :file:`{INSTALL}` is something like -# :file:`/usr/lib/python3.7/site-packages` on Linux, and maybe -# :file:`C:\\Python37\\Lib\\site-packages` on Windows. Every time you +# :file:`/usr/lib/python3.9/site-packages` on Linux, and maybe +# :file:`C:\\Python39\\Lib\\site-packages` on Windows. Every time you # install matplotlib, this file will be overwritten, so if you want # your customizations to be saved, please move this file to your # user-specific matplotlib directory.