marsilea.plotter.Numbers#

class Numbers(data, width=0.8, color='C0', orient=None, show_value=True, fmt=None, label=None, label_loc=None, label_props=None, value_pad=2.0, props=None, **kwargs)#

Bases: _BarBase

Show numbers in bar plot

This is used to show 1D data specifically.

Parameters:
datanp.ndarray

1D data

widthfloat

The width of bar

colorcolor or list of color

The color of bar

show_valuebool

Whether to show value on the bar

fmtstr, callable

Format the value show on the bar

labelstr

The label of the plot

value_padfloat

The spacing between label and the plot

propsdict

See matplotlib.text.Text

Examples

>>> import marsilea as ma
>>> from marsilea.plotter import Numbers
>>> data = np.random.randint(1, 10, 10)
>>> _, ax = plt.subplots()
>>> Numbers(data).render(ax)
../../_images/marsilea-plotter-Numbers-1.png