Skip to content

beautiplot.plot.markers#

beautiplot.plot.markers #

markers(
    ax: Axes,
    x: int | float | ndarray | Sequence[int | float],
    y: int | float | ndarray | Sequence[int | float],
    marker: str = 'o',
    ms: int = 8,
    mec: str = 'white',
    mew: float = 0.5,
    ls: str = 'None',
    **kwargs: Any,
) -> None

Plot markers on the axes.

Parameters:

  • ax (Axes) –

    The axes to plot on.

  • x (int | float | ndarray | Sequence[int | float]) –

    The x-coordinates of the markers.

  • y (int | float | ndarray | Sequence[int | float]) –

    The y-coordinates of the markers.

  • marker (str, default: 'o' ) –

    The marker style.

  • ms (int, default: 8 ) –

    The marker size.

  • mec (str, default: 'white' ) –

    The marker edge color.

  • mew (float, default: 0.5 ) –

    The marker edge width.

  • ls (str, default: 'None' ) –

    The line style.

  • **kwargs (Any, default: {} ) –

    Additional keyword arguments to pass to ax.plot.

Example

See the discretized colorbar tutorial.

Source code in src/beautiplot/plot.py
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
def markers(
    ax: matplotlib.axes.Axes,
    x: int | float | np.ndarray | Sequence[int | float],
    y: int | float | np.ndarray | Sequence[int | float],
    marker: str = 'o',
    ms: int = 8,
    mec: str = 'white',
    mew: float = 0.5,
    ls: str = 'None',
    **kwargs: Any,
) -> None:
    """Plot markers on the axes.

    Args:
        ax: The axes to plot on.
        x: The x-coordinates of the markers.
        y: The y-coordinates of the markers.
        marker: The marker style.
        ms: The marker size.
        mec: The marker edge color.
        mew: The marker edge width.
        ls: The line style.
        **kwargs: Additional keyword arguments to pass to `ax.plot`.

    Example:
        See the
        [discretized colorbar tutorial](../../../tutorials/discretized_colorbar.md).
    """  # noqa: W505
    ax.plot(x, y, marker=marker, ms=ms, mec=mec, mew=mew, ls=ls, **kwargs)