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 @@ -864,6 +864,35 @@ are delimited by a line of ``###`` characters:
864864
865865 In this way text, code, and figures are output in a "notebook" style.
866866
867+ References for sphinx-gallery
868+ -----------------------------
869+
870+ The showcased Matplotlib functions should be listed in an admonition at the
871+ bottom as follows
872+
873+ .. code-block :: python
874+
875+ # ##############################################################################
876+ #
877+ # .. admonition:: References
878+ #
879+ # The use of the following functions, methods, classes and modules is shown
880+ # in this example:
881+ #
882+ # - `matplotlib.axes.Axes.fill` / `matplotlib.pyplot.fill`
883+ # - `matplotlib.axes.Axes.axis` / `matplotlib.pyplot.axis`
884+
885+ This allows sphinx-gallery to place an entry to the example in the
886+ mini-gallery of the mentioned functions. Whether or not a function is mentioned
887+ here should be decided depending on if a mini-gallery link prominently helps
888+ to illustrate that function; e.g. mention ``matplotlib.pyplot.subplots `` only
889+ in examples that are about laying out subplots, not in every example that uses
890+ it.
891+
892+ Functions that exist in ``pyplot `` as well as in Axes or Figure should mention
893+ both references no matter which one is used in the example code. The ``pyplot ``
894+ reference should always be the second to mention; see the example above.
895+
867896Order of examples in the gallery
868897--------------------------------
869898
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