@@ -814,7 +814,9 @@ from having an plot generated insert "sgskip" somewhere in the filename.
814814
815815The format of these files is relatively straightforward. Properly
816816formatted 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
819821For instance the example :doc: `/gallery/lines_bars_and_markers/simple_plot `
820822example is generated from
@@ -853,7 +855,7 @@ Tutorials are made with the exact same mechanism, except they are longer, and
853855typically have more than one comment block (i.e.
854856:doc: `/tutorials/introductory/quick_start `). The first comment block
855857can 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