holoviz / hvplot

A high-level plotting API for pandas, dask, xarray, and networkx built on HoloViews
https://hvplot.holoviz.org
BSD 3-Clause "New" or "Revised" License
1.12k stars 108 forks source link

add stemplot #443

Open fkromer opened 4 years ago

fkromer commented 4 years ago

Is your feature request related to a problem? Please describe.

I'd like to plot data as stemplot. Seems like there is no stemplot supported yet.

Describe the solution you'd like

Porting the functionality from matplotlib.pyplot.stem would be reasonable.

philippjfr commented 4 years ago

Currently you should be able to emulate this with:

spikes = hv.Spikes((x_vals, y_vals))
spikes * hv.Scatter(spikes)
fkromer commented 4 years ago

@philippjfr Thx for the workaround. I'm using hvplot via the pandas plotting backend. How do I have to adjust your hint? pd.DataFrame.plot(kind='Spikes', x='x axis label', y='y axis label').plot(kind='Scatter')

philippjfr commented 4 years ago

Oh right, didn't see you posted this on hvPlot. I don't think we currently expose Spikes through hvPlot. This should do it:

import holoviews as hv
scatter = df.plot.scatter(x='x axis label', y='y axis label')
hv.Spikes(scatter) * scatter
fkromer commented 4 years ago
import holoviews as hv
scatter = df.plot(kind='scatter', x='retention time', y='intensity')
hv.Spikes(scatter) * scatter

works. Thx.

ahuang11 commented 2 months ago

I think we should still expose spikes in hvplot.

maximlt commented 2 months ago

I think we should still expose spikes in hvplot.

Maybe update the title too to reflect that? Some people may look for spikes, some others for stem (there are maybe other names for this kind of plot).

philippjfr commented 2 months ago

stem is definitely much more standard than spikes.