Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 0c9af39

Browse filesBrowse files
committed
add discouraged admonishment to plt.xkcd
1 parent 0078937 commit 0c9af39
Copy full SHA for 0c9af39

File tree

1 file changed

+21
-5
lines changed
Filter options

1 file changed

+21
-5
lines changed

‎lib/matplotlib/pyplot.py

Copy file name to clipboardExpand all lines: lib/matplotlib/pyplot.py
+21-5Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -705,13 +705,29 @@ def setp(obj, *args, **kwargs):
705705
def xkcd(
706706
scale: float = 1, length: float = 100, randomness: float = 2
707707
) -> ExitStack:
708-
"""
709-
Turn on `xkcd <https://xkcd.com/>`_ sketch-style drawing mode.
708+
r"""
709+
[*Discouraged*] Turn on `xkcd <https://xkcd.com/>`_ sketch-style drawing mode.
710+
711+
.. admonition:: Discouraged
712+
713+
The use of ``plt.xkcd()`` is discouraged; instead use
714+
the ``xkcd`` style sheet::
715+
716+
plt.style.use('xkcd')
717+
with plt.style.use('xkcd'):
718+
719+
Instead of passing in arguments, modify the ``rcParam``::
720+
721+
import matplotlib as mpl
722+
723+
mpl.rcParams['path.sketch'] = (scale, length, randomness)
724+
725+
For more information, see :ref:`customizing`
710726
711-
This will only have an effect on things drawn after this function is called.
712727
713-
For best results, install the `xkcd script <https://github.com/ipython/xkcd-font/>`_
714-
font; xkcd fonts are not packaged with Matplotlib.
728+
This drawing mode only affects things drawn after this function is called.
729+
For best results, the "xkcd script" font should be installed; it is
730+
not included with Matplotlib.
715731
716732
Parameters
717733
----------

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.