@@ -250,7 +250,7 @@ def setp(*args, **kwargs):
250250 return ret
251251
252252
253- def xkcd ():
253+ def xkcd (scale = 1 , length = 100 , randomness = 2 ):
254254 """
255255 Turns on `xkcd <http://xkcd.com/>`_ sketch-style drawing mode.
256256 This will only have effect on things drawn after this function is
@@ -259,6 +259,15 @@ def xkcd():
259259 For best results, the "Humor Sans" font should be installed: it is
260260 not included with matplotlib.
261261
262+ Parameters
263+ ----------
264+ scale: float, optional
265+ The amplitude of the wiggle perpendicular to the source line.
266+ length: float, optional
267+ The length of the wiggle along the line.
268+ randomness: float, optional
269+ The scale factor by which the length is shrunken or expanded.
270+
262271 This function works by a number of rcParams, so it will probably
263272 override others you have set before.
264273
@@ -282,7 +291,7 @@ def xkcd():
282291 try :
283292 rcParams ['font.family' ] = ['Humor Sans' , 'Comic Sans MS' ]
284293 rcParams ['font.size' ] = 14.0
285- rcParams ['path.sketch' ] = (1 , 100 , 2 )
294+ rcParams ['path.sketch' ] = (scale , length , randomness )
286295 rcParams ['path.effects' ] = [
287296 patheffects .withStroke (linewidth = 4 , foreground = "w" )]
288297 rcParams ['axes.linewidth' ] = 1.5
0 commit comments