Scatter#
import hvplot.pandas # noqa
scatter
plots are a good first way to plot data with non continuous axes.
from bokeh.sampledata.iris import flowers as df
df.sample(n=5)
sepal_length | sepal_width | petal_length | petal_width | species | |
---|---|---|---|---|---|
82 | 5.8 | 2.7 | 3.9 | 1.2 | versicolor |
48 | 5.3 | 3.7 | 1.5 | 0.2 | setosa |
89 | 5.5 | 2.5 | 4.0 | 1.3 | versicolor |
49 | 5.0 | 3.3 | 1.4 | 0.2 | setosa |
137 | 6.4 | 3.1 | 5.5 | 1.8 | virginica |
df.hvplot.scatter(x='sepal_length', y='sepal_width', by='species',
legend='top', height=400, width=400)
As for most other types of hvPlot plots, you can add fields to the hover display using the hover_cols
argument. It can also take “all” as input to show all fields.
df.hvplot.scatter(x='sepal_length', y='sepal_width', s='petal_length', scale=5, by='species',
legend='top', height=400, width=600,
hover_cols=["species", "sepal_length", "sepal_width", "petal_width"])
You can add the ‘s’ parameter in scatter to specify the marker plot size and add the ‘scale’ parameter to specify what the scaling factor should be.
This web page was generated from a Jupyter notebook and not all
interactivity will work on this website.