@@ -350,19 +350,19 @@ An example docstring looks like:
350
350
Respective beginning and end of each line. If scalars are
351
351
provided, all lines will have the same length.
352
352
353
- colors : array-like of colors, optional, default: 'k'
353
+ colors : array-like of colors, default: 'k'
354
354
355
- linestyles : {'solid', 'dashed', 'dashdot', 'dotted'}, optional
355
+ linestyles : {'solid', 'dashed', 'dashdot', 'dotted'}, default: 'solid'
356
356
357
- label : string, optional , default: ''
357
+ label : str , default: ''
358
358
359
359
Returns
360
360
-------
361
361
lines : `~matplotlib.collections.LineCollection`
362
362
363
363
Other Parameters
364
364
----------------
365
- **kwargs : `~matplotlib.collections.LineCollection` properties.
365
+ **kwargs : `~matplotlib.collections.LineCollection` properties
366
366
367
367
See also
368
368
--------
@@ -420,9 +420,19 @@ precisely in the text.
420
420
Generally, the `numpydoc docstring guide `_ conventions apply. The following
421
421
rules expand on them where the numpydoc conventions are not specific.
422
422
423
+ As opposed to the numpydoc guide, parameters need not be marked as
424
+ *optional * if they have a simple default. This removes unnecessary clutter.
425
+ The optional aspect is already clear from the presence of a default value.
426
+ More specifically
427
+
428
+ - use `{name} : {type}, default: {val} ` when possible.
429
+ - use `{name} : {type}, optional ` and describe the default in the text if
430
+ in cannot be explained sufficiently in the above way.
431
+
423
432
Use ``float `` for a type that can be any number.
424
433
425
- Use ``(float, float) `` to describe a 2D position.
434
+ Use ``(float, float) `` to describe a 2D position. The parentheses should be
435
+ included to make the tuple-ness more obvious.
426
436
427
437
Use ``array-like `` for homogeneous numeric sequences, which could
428
438
typically be a numpy.array. Dimensionality may be specified using ``2D ``,
@@ -460,7 +470,7 @@ Use abbreviated links ```.Normalize``` in the text.
460
470
461
471
.. code-block :: rst
462
472
463
- norm : `~matplotlib.colors.Normalize`, optional
473
+ norm : `~matplotlib.colors.Normalize`
464
474
A `.Normalize` instance is used to scale luminance data to 0, 1.
465
475
466
476
``See also `` sections
0 commit comments