Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 6044b30

Browse files
committed
DOC: document sg separator preference
1 parent fb3fe4a commit 6044b30

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

doc/devel/documenting_mpl.rst

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -814,7 +814,9 @@ from having an plot generated insert "sgskip" somewhere in the filename.
814814

815815
The format of these files is relatively straightforward. Properly
816816
formatted comment blocks are treated as ReST_ text, the code is
817-
displayed, and figures are put into the built page.
817+
displayed, and figures are put into the built page. Matplotlib uses the
818+
``# %%`` section separator so that IDEs will identify "code cells" to make
819+
it easy to re-run sub-sections of the example.
818820

819821
For instance the example :doc:`/gallery/lines_bars_and_markers/simple_plot`
820822
example is generated from
@@ -853,7 +855,7 @@ Tutorials are made with the exact same mechanism, except they are longer, and
853855
typically have more than one comment block (i.e.
854856
:doc:`/tutorials/introductory/quick_start`). The first comment block
855857
can be the same as the example above. Subsequent blocks of ReST text
856-
are delimited by a line of ``###`` characters:
858+
are delimited by the line ``# %%`` :
857859

858860
.. code-block:: python
859861
@@ -868,7 +870,7 @@ are delimited by a line of ``###`` characters:
868870
ax.grid()
869871
plt.show()
870872
871-
##########################################################################
873+
# %%
872874
# Second plot
873875
# ===========
874876
#
@@ -887,7 +889,7 @@ bottom as follows
887889

888890
.. code-block:: python
889891
890-
###############################################################################
892+
# %%
891893
#
892894
# .. admonition:: References
893895
#

0 commit comments

Comments
 (0)