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
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
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)