@@ -142,7 +142,7 @@ It is useful to strive for consistency in the Matplotlib documentation. Here
142142are some formatting and style conventions that are used.
143143
144144Section formatting
145- ~~~~~~~~~~~~~~~~~~
145+ ^^^^^^^^^^^^^^^^^^
146146
147147Use `sentence case <https://apastyle.apa.org/style-grammar-guidelines/capitalization/sentence-case >`__
148148``Upper lower `` for section titles, e.g., ``Possible hangups `` rather than
@@ -163,8 +163,25 @@ for section markup characters, i.e.:
163163
164164This may not yet be applied consistently in existing docs.
165165
166+ Table formatting
167+ ^^^^^^^^^^^^^^^^
168+ Given the size of the table and length of each entry, use:
169+
170+ +-------------+-------------------------------+--------------------+
171+ | | small table | large table |
172+ +-------------+-------------------------------+--------------------+
173+ | short entry | `simple or grid table <sg >`_ | `grid table <sg >`_ |
174+ +-------------+-------------------------------+--------------------+
175+ | long entry | `list table <lt >`_ | `csv table <csv >`_ |
176+ +-------------+-------------------------------+--------------------+
177+
178+ For more information, see `rst tables <https://www.sphinx-doc.org/en/master/usage/restructuredtext/directives.html#tables >`_.
179+ .. _sg : https://www.sphinx-doc.org/en/master/usage/restructuredtext/basics.html#tables
180+ .. _lt : https://docutils.sourceforge.io/docs/ref/rst/directives.html#list-table
181+ .. _csv : https://docutils.sourceforge.io/docs/ref/rst/directives.html#toc-entry-22
182+
166183Function arguments
167- ~~~~~~~~~~~~~~~~~~
184+ ^^^^^^^^^^^^^^^^^^
168185
169186Function arguments and keywords within docstrings should be referred to using
170187the ``*emphasis* `` role. This will keep Matplotlib's documentation consistent
@@ -445,7 +462,8 @@ and the Sphinx_ documentation. Some Matplotlib-specific formatting conventions
445462to keep in mind:
446463
447464Quote positions
448- ~~~~~~~~~~~~~~~
465+ ^^^^^^^^^^^^^^^
466+
449467The quotes for single line docstrings are on the same line (pydocstyle D200)::
450468
451469 def get_linewidth(self):
@@ -461,7 +479,8 @@ The quotes for multi-line docstrings are on separate lines (pydocstyle D213)::
461479 """
462480
463481Function arguments
464- ~~~~~~~~~~~~~~~~~~
482+ ^^^^^^^^^^^^^^^^^^
483+
465484Function arguments and keywords within docstrings should be referred to
466485using the ``*emphasis* `` role. This will keep Matplotlib's documentation
467486consistent with Python's documentation:
@@ -478,7 +497,8 @@ Do not use the ```default role``` or the ````literal```` role:
478497
479498
480499 Quotes for strings
481- ~~~~~~~~~~~~~~~~~~
500+ ^^^^^^^^^^^^^^^^^^
501+
482502Matplotlib does not have a convention whether to use single-quotes or
483503double-quotes. There is a mixture of both in the current code.
484504
@@ -495,7 +515,8 @@ slightly improve the rendered docs, they are cumbersome to type and difficult
495515to read in plain-text docs.
496516
497517Parameter type descriptions
498- ~~~~~~~~~~~~~~~~~~~~~~~~~~~
518+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^
519+
499520The main goal for parameter type descriptions is to be readable and
500521understandable by humans. If the possible types are too complex use a
501522simplification for the type description and explain the type more
@@ -534,7 +555,8 @@ Non-numeric homogeneous sequences are described as lists, e.g.::
534555 list of `.Artist`
535556
536557Reference types
537- ~~~~~~~~~~~~~~~
558+ ^^^^^^^^^^^^^^^
559+
538560Generally, the rules from referring-to-other-code _ apply. More specifically:
539561
540562Use full references ```~matplotlib.colors.Normalize` `` with an
@@ -550,7 +572,8 @@ Use abbreviated links ```.Normalize``` in the text.
550572 A `.Normalize` instance is used to scale luminance data to 0, 1.
551573
552574 Default values
553- ~~~~~~~~~~~~~~
575+ ^^^^^^^^^^^^^^
576+
554577As opposed to the numpydoc guide, parameters need not be marked as
555578*optional * if they have a simple default:
556579
@@ -592,7 +615,8 @@ effect.
592615
593616
594617 ``See also `` sections
595- ~~~~~~~~~~~~~~~~~~~~~
618+ ^^^^^^^^^^^^^^^^^^^^^
619+
596620Sphinx automatically links code elements in the definition blocks of ``See
597621also `` sections. No need to use backticks there::
598622
@@ -602,7 +626,8 @@ also`` sections. No need to use backticks there::
602626 axhline : horizontal line across the Axes
603627
604628Wrap parameter lists
605- ~~~~~~~~~~~~~~~~~~~~
629+ ^^^^^^^^^^^^^^^^^^^^
630+
606631Long parameter lists should be wrapped using a ``\ `` for continuation and
607632starting on the new line without any indent (no indent because pydoc will
608633parse the docstring and strip the line continuation so that indent would
@@ -627,7 +652,8 @@ Alternatively, you can describe the valid parameter values in a dedicated
627652section of the docstring.
628653
629654rcParams
630- ~~~~~~~~
655+ ^^^^^^^^
656+
631657rcParams can be referenced with the custom ``:rc: `` role:
632658:literal: `:rc:\` foo\` ` yields ``rcParams["foo"] = 'default' ``, which is a link
633659to the :file: `matplotlibrc ` file description.
0 commit comments