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

Legend issues with pandas-bokeh #66

Closed
nrapanos opened this issue May 13, 2020 · 11 comments
Closed

Legend issues with pandas-bokeh #66

nrapanos opened this issue May 13, 2020 · 11 comments

Comments

@nrapanos
Copy link

Hello - I am experiencing the following issues with pandas_bokeh:

  1. When I plot a large number of timeseries, the legend reaches the maximum number and does not allow scrolling to reveal the rest of the timeseries that have been plotted.
  2. Datetime works on the x-axis but on hover it is interpreted in a weird format.

The following plot demonstrates both problems.

bokeh

@PatrikHlobil
Copy link
Owner

Hi @nrapanos,

thanks for your feedback.

  1. There is no scroll option available so far for legends in Bokeh. However, I will add a legend_fontsize option in the next release of Pandas-Bokeh (0.5), but for now, you can just do
p = df.plot_bokeh(..., show_figure=False)

p.legend.label_text_font_size = "8px"

pandas_bokeh.show(p)
  1. This is an issue with the most recent Bokeh version (>=2.0). Please upgrade Pandas-Bokeh to 0.4.3 to fix that datetime hover problem.

Best Patrik

@nrapanos
Copy link
Author

nrapanos commented May 13, 2020 via email

@PatrikHlobil
Copy link
Owner

Ok. Can you do a pip list on the command line please?

Best Patrik

@nrapanos
Copy link
Author

nrapanos commented May 13, 2020 via email

@PatrikHlobil
Copy link
Owner

Hi,

unfortunately the images are not correctly shown...

@nrapanos
Copy link
Author

nrapanos commented May 13, 2020 via email

@PatrikHlobil
Copy link
Owner

PatrikHlobil commented May 13, 2020

Thanks, the dependencies should be fine. Could you give a minimal code example where you see the hovertool issues please?

Using the following example I see the dates correctly displayed in the hovertool:

import pandas as pd
import pandas_bokeh
pandas_bokeh.output_notebook()

import numpy as np

np.random.seed(42)
df = pd.DataFrame({"Google": np.random.randn(1000)+0.2, 
                   "Apple": np.random.randn(1000)+0.17}, 
                   index=pd.date_range('1/1/2000', periods=1000))
df = df.cumsum()
df = df + 50
df.plot_bokeh(kind="line")   

image

Best Patrik

@PatrikHlobil PatrikHlobil reopened this May 13, 2020
@nrapanos
Copy link
Author

hmm interesting...this is that I get. i will investigate a bit on my end.

temp

@PatrikHlobil
Copy link
Owner

Maybe try to reload the Kernel?

@nrapanos
Copy link
Author

I tried that many times, I even closed my PyCharm and rebooted, but the problem persists.
It's ok, to be honest it doesn't bother me very much.

On another note, do you think we could ask the bokeh community to allow the legend to be scrollable? That would be more important to me.

@PatrikHlobil
Copy link
Owner

Sure, you can always ask for a feature. I think it is a good idea, however a pretty narrow usecase. Best Patrik

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants