File tree Expand file tree Collapse file tree 3 files changed +36
-13
lines changed
examples/lines_bars_and_markers Expand file tree Collapse file tree 3 files changed +36
-13
lines changed Original file line number Diff line number Diff line change @@ -439,7 +439,7 @@ div.note {
439439 border-color : # ccc ;
440440}
441441
442- div .seealso {
442+ div .seealso , div . admonition-references {
443443 background-color : # EAF1F7 ;
444444 border-color : # 8EADCC ;
445445 color : # 3F5E7F ;
Original file line number Diff line number Diff line change @@ -859,6 +859,35 @@ are delimited by a line of ``###`` characters:
859859
860860 In this way text, code, and figures are output in a "notebook" style.
861861
862+ References for sphinx-gallery
863+ -----------------------------
864+
865+ The showcased Matplotlib functions should be listed in an admonition at the
866+ bottom as follows
867+
868+ .. code-block :: python
869+
870+ # ##############################################################################
871+ #
872+ # .. admonition:: References
873+ #
874+ # The use of the following functions, methods, classes and modules is shown
875+ # in this example:
876+ #
877+ # - `matplotlib.axes.Axes.fill` / `matplotlib.pyplot.fill`
878+ # - `matplotlib.axes.Axes.axis` / `matplotlib.pyplot.axis`
879+
880+ This allows sphinx-gallery to place an entry to the example in the
881+ mini-gallery of the mentioned functions. Whether or not a function is mentioned
882+ here should be decided depending on if a mini-gallery link prominently helps
883+ to illustrate that function; e.g. mention ``matplotlib.pyplot.subplots `` only
884+ in examples that are about laying out subplots, not in every example that uses
885+ it.
886+
887+ Functions that exist in ``pyplot `` as well as in Axes or Figure should mention
888+ both references no matter which one is used in the example code. The ``pyplot ``
889+ reference should always be the second to mention; see the example above.
890+
862891Order of examples in the gallery
863892--------------------------------
864893
Original file line number Diff line number Diff line change @@ -76,18 +76,12 @@ def _koch_snowflake_complex(order):
7676
7777plt .show ()
7878
79- #############################################################################
79+ ###############################################################################
8080#
81- # ------------
81+ # .. admonition:: References
8282#
83- # References
84- # """"""""""
83+ # The use of the following functions, methods, classes and modules is shown
84+ # in this example:
8585#
86- # The use of the following functions, methods, classes and modules is shown
87- # in this example:
88-
89- import matplotlib
90- matplotlib .axes .Axes .fill
91- matplotlib .pyplot .fill
92- matplotlib .axes .Axes .axis
93- matplotlib .pyplot .axis
86+ # - `matplotlib.axes.Axes.fill` / `matplotlib.pyplot.fill`
87+ # - `matplotlib.axes.Axes.axis` / `matplotlib.pyplot.axis`
You can’t perform that action at this time.
0 commit comments