matplotlib.pyplot.xkcd#

matplotlib.pyplot.xkcd(scale=1,length=100,randomness=2)[source]#

Turn onxkcd sketch-style drawing mode.

This will only have an effect on things drawn after this function is called.

For best results, install thexkcd scriptfont; xkcd fonts are not packaged with Matplotlib.

Parameters:
scalefloat, optional

The amplitude of the wiggle perpendicular to the source line.

lengthfloat, optional

The length of the wiggle along the line.

randomnessfloat, optional

The scale factor by which the length is shrunken or expanded.

Notes

This function works by a number of rcParams, so it will probablyoverride others you have set before.

If you want the effects of this function to be temporary, it canbe used as a context manager, for example:

withplt.xkcd():# This figure will be in XKCD-stylefig1=plt.figure()# ...# This figure will be in regular stylefig2=plt.figure()

Examples usingmatplotlib.pyplot.xkcd#

XKCD

XKCD