PatrikHlobil / Pandas-Bokeh

Bokeh Plotting Backend for Pandas and GeoPandas

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

line_join option not respected? Jaggy line plots for noisy data

Thomasillo opened this issue · comments

Plotting noisy data using pandas_bokeh yields visually incorrect results.

import pandas as pd
import pandas_bokeh
import numpy as np

pd.set_option('plotting.backend', 'pandas_bokeh')
pandas_bokeh.output_notebook()

df = pd.DataFrame(np.random.rand(2000))
assert (df.min() > 0).all()
assert (df.max() < 1).all()
df.plot_bokeh(line_join="bevel", ylim=(-0.5,1.5))

Bildschirmfoto 2020-12-08 um 12 54 17

Doing the plot "by hand" does not.

from bokeh.plotting import figure
from bokeh.io import output_notebook, show
p1 = figure(title="bevel",plot_width=450, plot_height=250)
p1.line(df.index, df.iloc[:,0], line_join="bevel")
show(p1)

Bildschirmfoto 2020-12-08 um 12 56 54

Hi @Thomasillo ,

this is quite an interesting behaviour. thanks for reporting this issue. I will have a look at it.

Best Patrik

Interestingly, I cannot reproduce your behaviour.
image

Which version of Bokeh and Pandas-Bokeh are you using?

I am using
image

Best Patrik

Hi Patrik, my versions are

pd.__version__, bokeh.__version__, pandas_bokeh.__version__

('1.1.5', '2.2.3', '0.5.2')

Browser is Safari, but in firefox it's the same.

That is really weird. Maybe something MacOS specific?

HI @Thomasillo ,

I could reproduce such problems on iOS when running a Bokeh server.

Seems to be a problem with webkit and Bokeh itself.

I indeed found an old Bokeh issue here (bokeh/bokeh#7951). Maybe try to disable webgl via the option df.plot_bokeh(..., webgl=False).

Best Patrik