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

BoxPlot not working without label and values #5868

Closed
swenzel opened this issue Feb 14, 2017 · 5 comments
Closed

BoxPlot not working without label and values #5868

swenzel opened this issue Feb 14, 2017 · 5 comments

Comments

@swenzel
Copy link

swenzel commented Feb 14, 2017

Description of expected behavior and the observed behavior

The documentation of bokeh.charts.BoxPlot claims that label and values are optional and I get the impression that supplying a simple one-dimensional dataset is sufficient to create a BoxPlot.
Turns out I'm wrong, took me quite some time to figure out why the example works but my code didn't.
Apparently the reason is that it only works with a DataFrame having at least two columns, one being the values and one the labels.

Admittedly the documentation states:

Create a BoxPlot chart [...] from table-like data.

Still, I think it should be possible to use it with 1D datasets.
I'd expect bokeh to add some tag for label and value by itself in that case. Be it None, 0, 1, N/A or whatever. Maybe it does... as far as I can see, there are no python errors. It fails on the JavaScript side though. In Firefox, on first trial it says TypeError: _ is null and afterwards Error: Error rendering Bokeh model: could not find tag with id: ....

Complete, minimal, self-contained example code that reproduces the issue

Working example code with output_notebook:

from bokeh.charts import BoxPlot, show, output_notebook
from bokeh.layouts import row
from bokeh.sampledata.autompg import autompg as df

box = BoxPlot(df, values='mpg', label='cyl', plot_width=400)
box2 = BoxPlot(df, values='mpg', label='cyl', color='cyl',
               title="MPG Box Plot by Cylinder Count", plot_width=400)

output_notebook()
show(row(box, box2))

Non-working example code with 1D data-set:

from bokeh.charts import BoxPlot, show, output_notebook
from bokeh.layouts import row
from bokeh.sampledata.autompg import autompg as df

box = BoxPlot(df['mpg'], plot_width=400)

output_notebook()
show(box)

Notebook with test code and output (.txt is actually .ipynb but GitHub didn't accept):
BoxPlotTest.txt

ALL software version info (bokeh, python, notebook, OS, browser, any other relevant pacakges)

Notebook Server OS:
Red Hat Enterprise Linux Server release 7.2 (Maipo)
Linux kernel: 3.10.0-327.13.1.el7.x86_64

Server's Python Version:
2.7.5

Server's Python Modules:
PipFreeze.txt

Client OS:
Windows 10 x64 (10.0.10586 Build 10586)

Client Browsers (tried both):
Google Chrome Version 56.0.2924.87 (64-bit)
Firefox Version 51.0.1 (32-Bit)

Stack traceback and/or browser JavaScript console output

Chrome_JS_Log.txt
Firefox_JS_Log.txt

@Maggie-M
Copy link
Contributor

moved to bkcharts repo

@alex1sc
Copy link

alex1sc commented May 17, 2017

I have this issue too.
Why in bkcharts repo #49 this issue is closed ?
As I understand it it's a charts issue not a 'bokeh' issue.

@bryevdv
Copy link
Member

bryevdv commented May 17, 2017

You linked the wrong issue. It is https://github.com/bokeh/bkcharts/issues/49 bokeh/bkcharts#49 which is open you linked to issue 49 in this repository.

@alex1sc
Copy link

alex1sc commented May 17, 2017

Ok thx.
I find a work around and put it in the right issue.

Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 28, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants