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

[BUG] AttributeError: unexpected attribute 'plot_width' to figure, similar attributes are outer_width, width or min_width #12543

Closed
Abonia1 opened this issue Nov 2, 2022 · 1 comment

Comments

@Abonia1
Copy link

Abonia1 commented Nov 2, 2022

Software versions

bokeh version: 3.0.0
python : 3.9.0

Browser name and version

No response

Jupyter notebook / Jupyter Lab version

VS jupyter notebook

Expected behavior

It should show the plot

Observed behavior

Error while excuting the code :
AttributeError Traceback (most recent call last)
Cell In [53], line 1
----> 1 show_coverage_over_time(df_coverage, interval='day')

File ~/opt/anaconda3/envs/waenv/lib/python3.9/site-packages/assistant_improve_toolkit/visualize_func.py:389, in show_coverage_over_time(df_coverage, interval)
385 coverage_data['Coverage'] = coverage_data['Coverage'].fillna(0)
387 output_notebook(hide_banner=True)
--> 389 p = figure(plot_width=950, plot_height=350, x_axis_type="datetime",
390 x_range=(start_datetime, end_datetime),
391 y_range=(max(np.floor(coverage_data['Coverage'].min()) - 10, 0),
392 min(np.floor(coverage_data['Coverage'].max()) + 10, 100)), title='Coverage over time')
394 p.line(x='response_datetime_interval', y='Coverage', source=coverage_data, line_width=1.5, color='#4fa8f6')
396 p.xaxis.formatter = DatetimeTickFormatter(
397 seconds=["%Y-%m-%d %H:%M:%S"],
398 minsec=["%Y-%m-%d %H:%M:%S"],
(...)
404 years=["%Y-%m-%d %H:%M:%S"],
405 )

File ~/opt/anaconda3/envs/waenv/lib/python3.9/site-packages/bokeh/plotting/_figure.py:184, in figure.init(self, *arg, **kw)
182 for name in kw.keys():
183 if name not in names:
--> 184 self._raise_attribute_error_with_matches(name, names | opts.properties())
186 super().init(*arg, **kw)
...
366 if not matches:
367 matches, text = sorted(properties), "possible"
--> 369 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

Example code

p = figure(plot_width=950, plot_height=350, x_axis_type="datetime",
                   x_range=(start_datetime, end_datetime),
                   y_range=(max(np.floor(coverage_data['Coverage'].min()) - 10, 0),
                            min(np.floor(coverage_data['Coverage'].max()) + 10, 100)), title='Coverage over time')

Stack traceback or browser console output

No response

Screenshots

No response

@Abonia1 Abonia1 added the TRIAGE label Nov 2, 2022
@bryevdv
Copy link
Member

bryevdv commented Nov 2, 2022

Hi @Abonia1 plot_width (and plot_height) were deprecated some time ago, and were finally removed in new major release version 3.0. This is an intentional breaking change, so you will need to update your code in order to use version 3.0. Please see the migration guide:

https://github.com/bokeh/bokeh/wiki/Migration-Guides#300

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

No branches or pull requests

2 participants