Create a stem plot. A stem plot draws lines perpendicular to a baseline at each location *locs* from the baseline to *heads*, and places a marker there. For vertical stem plots (the default), the *locs* are *x* positions, and the *heads* are *y* values. For
(self, *args, linefmt=None, markerfmt=None, basefmt=None, bottom=0,
label=None, orientation='vertical')
| 3374 | |
| 3375 | @_preprocess_data() |
| 3376 | def stem(self, *args, linefmt=None, markerfmt=None, basefmt=None, bottom=0, |
| 3377 | label=None, orientation='vertical'): |
| 3378 | """ |
| 3379 | Create a stem plot. |
| 3380 | |
| 3381 | A stem plot draws lines perpendicular to a baseline at each location |
| 3382 | *locs* from the baseline to *heads*, and places a marker there. For |
| 3383 | vertical stem plots (the default), the *locs* are *x* positions, and |
| 3384 | the *heads* are *y* values. For horizontal stem plots, the *locs* are |
| 3385 | *y* positions, and the *heads* are *x* values. |
| 3386 | |
| 3387 | Call signature:: |
| 3388 | |
| 3389 | stem([locs,] heads, linefmt=None, markerfmt=None, basefmt=None) |
| 3390 | |
| 3391 | The *locs*-positions are optional. *linefmt* may be provided as |
| 3392 | positional, but all other formats must be provided as keyword |
| 3393 | arguments. |
| 3394 | |
| 3395 | Parameters |
| 3396 | ---------- |
| 3397 | locs : array-like, default: (0, 1, ..., len(heads) - 1) |
| 3398 | For vertical stem plots, the x-positions of the stems. |
| 3399 | For horizontal stem plots, the y-positions of the stems. |
| 3400 | |
| 3401 | heads : array-like |
| 3402 | For vertical stem plots, the y-values of the stem heads. |
| 3403 | For horizontal stem plots, the x-values of the stem heads. |
| 3404 | |
| 3405 | linefmt : str, optional |
| 3406 | A string defining the color and/or linestyle of the vertical lines: |
| 3407 | |
| 3408 | ========= ============= |
| 3409 | Character Line Style |
| 3410 | ========= ============= |
| 3411 | ``'-'`` solid line |
| 3412 | ``'--'`` dashed line |
| 3413 | ``'-.'`` dash-dot line |
| 3414 | ``':'`` dotted line |
| 3415 | ========= ============= |
| 3416 | |
| 3417 | Default: 'C0-', i.e. solid line with the first color of the color |
| 3418 | cycle. |
| 3419 | |
| 3420 | Note: Markers specified through this parameter (e.g. 'x') will be |
| 3421 | silently ignored. Instead, markers should be specified using |
| 3422 | *markerfmt*. |
| 3423 | |
| 3424 | markerfmt : str, optional |
| 3425 | A string defining the color and/or shape of the markers at the stem |
| 3426 | heads. If the marker is not given, use the marker 'o', i.e. filled |
| 3427 | circles. If the color is not given, use the color from *linefmt*. |
| 3428 | |
| 3429 | basefmt : str, default: 'C3-' ('C2-' in classic mode) |
| 3430 | A format string defining the properties of the baseline. |
| 3431 | |
| 3432 | orientation : {'vertical', 'horizontal'}, default: 'vertical' |
| 3433 | The orientation of the stems. |