Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable the opportunity for a Legend for single data objects #1390

Open
mosc9575 opened this issue Aug 7, 2024 · 1 comment
Open

Enable the opportunity for a Legend for single data objects #1390

mosc9575 opened this issue Aug 7, 2024 · 1 comment
Labels
type: enhancement New feature or request type: upstream Anything that requires work outside hvPlot

Comments

@mosc9575
Copy link

mosc9575 commented Aug 7, 2024

At the moment hvplot doesn't offer the opportunity to add a legend if the data only has one entry.

The example below uses pandas, but I think this is also true for xarray and maybe others.

If I plot a line plot for a DataFrame with only on column, the y label is set by the name of the column. I can overwrite the default y label, but I can't force a legend, even in the docs it says legend is true by default.

import pandas as pd
import hvplot.pandas

df=pd.DataFrame({'a':[1,2,3], 'b':[3,2,1]})
df[['a']].hvplot(ylabel='€', legend='bottom') + df.hvplot(ylabel='€', legend='bottom')

grafik

I think it makes sense that a legend is deactivated for single column date by default, but it would be create, I a get the change to add one.

software details
Python version        :  3.12.4 (tags/v3.12.4:8e8a4ba, Jun  6 2024, 19:30:16) [MSC v.1940 64 bit (AMD64)]
IPython version       :  8.25.0
Tornado version       :  6.4.1
Bokeh version         :  3.4.3
BokehJS static path   :  C:\Users\mosc\Envs\fbpinn\Lib\site-packages\bokeh\server\static
node.js version       :  (not installed)
npm version           :  (not installed)
jupyter_bokeh version :  4.0.5
Operating system      :  Windows-10-10.0.19045-SP0
hvplot version        :  0.10.0
@hoxbro
Copy link
Member

hoxbro commented Aug 7, 2024

This needs to be done in HoloViews: holoviz/holoviews#4196

@maximlt maximlt added type: upstream Anything that requires work outside hvPlot type: enhancement New feature or request labels Sep 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement New feature or request type: upstream Anything that requires work outside hvPlot
Projects
None yet
Development

No branches or pull requests

3 participants