hvPlot.labels#

hvPlot.labels(x=None, y=None, text=None, **kwds)[source]#

Labels plot.

labels are mostly useful when overlaid on top of other plots using the * operator.

Reference: https://hvplot.holoviz.org/reference/tabular/labels.html

Parameters:
xstring, optional

The coordinate variable along the x-axis

ystring, optional

The coordinate variable along the y-axis

textstring, optional

The column to draw the text labels from; it’s also possible to provide a template string containing the column names to automatically format the text, e.g. “{col1}, {col2}”.

**kwdsoptional

Additional keywords arguments are documented in hvplot.help(‘labels’). See Plotting Options for more information.

Returns:
holoviews.element.Labels / Panel object

You can print the object to study its composition and run:

import holoviews as hv
hv.help(the_holoviews_object)

to learn more about its parameters and options.

References

Examples

import hvplot.pandas
import pandas as pd

df = pd.DataFrame(
    {'City': ['Buenos Aires', 'Brasilia', 'Santiago', 'Bogota', 'Caracas'],
    'Country': ['Argentina', 'Brazil', 'Chile', 'Colombia', 'Venezuela'],
    'Latitude': [-34.58, -15.78, -33.45, 4.60, 10.48],
    'Longitude': [-58.66, -47.91, -70.66, -74.08, -66.86],
    'Color': ['blue', 'green', 'white', 'black', 'yellow']})

df.hvplot.points(x='Longitude', y='Latitude') *             df.hvplot.labels(x='Longitude', y='Latitude', text='City', text_baseline="bottom")

Backend-specific styling options#

angle, background_fill_alpha, background_fill_color, background_hatch_alpha, background_hatch_color, background_hatch_extra, background_hatch_pattern, background_hatch_scale, background_hatch_weight, border_alpha, border_color, border_line_alpha, border_line_cap, border_line_color, border_line_dash, border_line_dash_offset, border_line_join, border_line_width, border_radius, cmap, muted, text_align, text_alpha, text_baseline, text_color, text_font, text_font_size, text_font_style, visible

alpha, c, cmap, color, family, horizontalalignment, rotation, s, size, verticalalignment, visible, weight

Examples#

TBD

This web page was generated from a Jupyter notebook and not all interactivity will work on this website.