PatrikHlobil / Pandas-Bokeh

Bokeh Plotting Backend for Pandas and GeoPandas

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Is update to recent bokeh planned?

zdenop opened this issue · comments

commented
import pandas as pd
import pandas_bokeh
pandas_bokeh.output_notebook()

cause warning:

BokehDeprecationWarning: 'tile_providers module' was deprecated in Bokeh 3.0.0 and will be removed, use 'add_tile directly' instead.
BokehJS 3.1.1 successfully loaded.

and

dfx = pd.DataFrame({
    'Month': ['2021-01', '2021-02', '2021-03', '2021-04'],
    'Total': [1500, 1200, 1700, 1600],
    'Average': [75.0, 63.15, 73.91, 76.19],
})
dfx.plot_bokeh(x="Month",
               title="Example",
               line_width=4,
               ylabel = "Totals",
               colormap=["#0000ff99", "#ff000099"])

cause error:

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
Cell In[2], line 6
      1 dfx = pd.DataFrame({
      2     'Month': ['2021-01', '2021-02', '2021-03', '2021-04'],
      3     'Total': [1500, 1200, 1700, 1600],
      4     'Average': [75.0, 63.15, 73.91, 76.19],
      5 })
----> 6 dfx.plot_bokeh(x="Month",
      7                title="Example",
      8                line_width=4,
      9                ylabel = "Totals",
     10                colormap=["#0000ff99", "#ff000099"])

File C:\Python\Python39\lib\site-packages\pandas_bokeh\plot.py:1785, in FramePlotMethods.__call__(self, *args, **kwargs)
   1784 def __call__(self, *args, **kwargs):
-> 1785     return plot(self.df, *args, **kwargs)

File C:\Python\Python39\lib\site-packages\pandas_bokeh\plot.py:439, in plot(df_in, x, y, kind, figsize, use_index, title, legend, logx, logy, xlabel, ylabel, xticks, yticks, xlim, ylim, fontsize_title, fontsize_label, fontsize_ticks, fontsize_legend, color, colormap, category, histogram_type, stacked, weights, bins, normed, cumulative, show_average, plot_data_points, plot_data_points_size, number_format, disable_scientific_axes, show_figure, return_html, panning, zooming, sizing_mode, toolbar_location, hovertool, hovertool_string, rangetool, vertical_xlabel, x_axis_location, webgl, reuse_plot, **kwargs)
    432     xlabelname = (
    433         figure_options["x_axis_label"]
    434         if figure_options.get("x_axis_label", "") != ""
    435         else "x"
    436     )
    438 # Create Figure for plotting:
--> 439 p = figure(**figure_options)
    440 if "x_axis_type" not in figure_options:
    441     figure_options["x_axis_type"] = None

File C:\Python\Python39\lib\site-packages\bokeh\plotting\_figure.py:190, in figure.__init__(self, *arg, **kw)
    188 for name in kw.keys():
    189     if name not in names:
--> 190         self._raise_attribute_error_with_matches(name, names | opts.properties())
    192 super().__init__(*arg, **kw)
    194 self.x_range = get_range(opts.x_range)

File C:\Python\Python39\lib\site-packages\bokeh\core\has_props.py:368, in HasProps._raise_attribute_error_with_matches(self, name, properties)
    365 if not matches:
    366     matches, text = sorted(properties), "possible"
--> 368 raise AttributeError(f"unexpected attribute {name!r} to {self.__class__.__name__}, {text} attributes are {nice_join(matches)}")

AttributeError: unexpected attribute 'plot_width' to figure, similar attributes are outer_width, width or min_width