8000 content guidelines · matplotlib/matplotlib@3093437 · GitHub
[go: up one dir, main page]

Skip to content

Commit 3093437

Browse files
committed
content guidelines
1 parent 60d2f95 commit 3093437

File tree

1 file changed

+94
-0
lines changed

1 file changed

+94
-0
lines changed

doc/devel/document.rst

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1045,6 +1045,100 @@ subdirectory, but :file:`galleries/users_explain/artists` has a mix of
10451045
any ``*.rst`` files to a ``:toctree:``, either in the ``README.txt`` or in a
10461046
manual ``index.rst``.
10471047

1048+
1049+
.. _writing-user-guide:
1050+
1051+
Write user guide documentation
1052+
==============================
1053+
1054+
The pages in the :ref:`users-guide-index` are a mix of :ref:`ReST <writing-rest-pages>`
1055+
and :ref:`sphinx gallery <writing-examples-and-tutorials>` pages and should follow the
1056+
respective formatting conventions. The goal of the user guide is to explain how
1057+
Matplotlib works to someone who is unfamiliar with the library. To maintain the
1058+
consistency and cohesiveness of the user guide, documentation that is contributed to
1059+
this section should conform to the following guidelines:
1060+
1061+
Purpose: Explain how Matplotlib works
1062+
-------------------------------------
1063+
1064+
The aim of the user guide is to teach the concepts on which the Matplotlib API is
1065+
developed so that users can understand how to fit the individual components of the
1066+
library together. Therefore, content should be concept oriented rather than focused on
1067+
specific tasks, e.g.
1068+
1069+
Lines in Matplotlib
1070+
1071+
rather than *How do I make a squiggly yellow line?*
1072+
1073+
Audience: new users
1074+
-------------------
1075+
1076+
The audience for this guide are readers who are getting introduced to using Matplotlib
1077+
through this guide; therefore, content should be written with the assumption that the
1078+
reader does not yet know what Matplotlib calls a given visualization task nor
1079+
how any task is accomplished in Matplotlib. For example, each document should first
1080+
introduce or define the object/module/concept that it is discussing and why it is
1081+
important for the reader. e.g.
1082+
1083+
The `~.Line2D` class is an abstraction of a line and the ``LineCollection`` class is
1084+
an abstraction of a set of lines. ``Line2D`` and ``LineCollection`` objects manage
1085+
the properties and behavior of almost every line in an image. This means that one way
1086+
to modify a line is to call methods on its underlying object.*
1087+
1088+
1089+
Scope: Visualization using Matplotlib
1090+
-------------------------------------
1091+
1092+
Many concepts in Matplotlib assume a grounding in visualization, statistics, and
1093+
other topics to understand how they work. These concepts should be
1094+
contextualized using common terminilogy, but the focus should not stray from the
1095+
Matplotlib topic, e.g.
1096+
1097+
``Line2D`` objects take as input either pairwise coordinates (x,y) or y with an implicit
1098+
x. ``Line2D`` objects draw line segments between those points, thereby generating a
1099+
continuous representation.
1100+
1101+
Here *pairwise* and *continuous* are not defined because they are assumed to be known
1102+
by the audience, but the terms are used to explain what data ``Line2D`` accepts.
1103+
1104+
1105+
1106+
1107+
Teaching style: Chunking
1108+
------------------------
1109+
1110+
The material is introduced in small, usually one change or task at a time, chunks to
1111+
keep focus on the specific line of code enabling the given task. The aim is that by
1112+
reducing cognitive load, it will be easier for users to learn what each specific object
1113+
does and how it behaves. The goal is that gaining a conceptual understanding of
1114+
Matplotlib's API will make it easier for a user to navigate the rest of the
1115+
documentation.
1116+
1117+
For example, here the line object is introduced, then there is
1118+
one example of using a method on the object, then there is a link out to further
1119+
functionality::
1120+
1121+
For example, here the ``plot`` method returns a line object ``ln``::
1122+
1123+
ln, _ = plt.plot([1,2,3], color='blue')
1124+
1125+
One of the properties of a line is its color. It can be modified using the
1126+
``set_color`` method of ``Line2D``::
1127+
1128+
ln.set_color('orange')
1129+
1130+
1131+
Modifying ``ln``, we see that the color of the line is orange::
1132+
1133+
.. plot::
1134+
1135+
ln, _ = plt.plot([1,2,3], color='blue')
1136+
ln.set_color('orange')
1137+
1138+
1139+
For a full list of methods see `~.Line2D`
1140+
1141+
10481142
Miscellaneous
10491143
=============
10501144

0 commit comments

Comments
 (0)
0