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

plotting/bokeh/util.py depends on matplotlib even for bokeh backend #1807

Closed
cnblevins opened this issue Aug 16, 2017 · 5 comments
Closed

plotting/bokeh/util.py depends on matplotlib even for bokeh backend #1807

cnblevins opened this issue Aug 16, 2017 · 5 comments
Milestone

Comments

@cnblevins
Copy link

This is interesting because I can get hv.Table to work, but hv.Bars is throwing the following exception:

Traceback (most recent call last):
File "/app/.heroku/python/lib/python3.6/site-packages/holoviews/plotting/bokeh/util.py", line 120, in mpl_to_bokeh
v = colors.ColorConverter.colors.get(v, v)
AttributeError: 'NoneType' object has no attribute 'ColorConverter'
and
File "/app/.heroku/python/lib/python3.6/site-packages/holoviews/core/options.py", line 165, in exit
raise AbbreviatedException(etype, value, traceback)
holoviews.core.options.AbbreviatedException: AbbreviatedException: AttributeError: 'NoneType' object has no attribute 'ColorConverter'

The exception traces back to the following line in my code:
graph = hv.renderer('bokeh').server_doc(df3)

Details:

from requirements.txt:

bokeh==0.12.6
holoviews==1.8.2

from app.py:

import holoviews as hv
hv.extension('bokeh')

and

def graph_alpha(dataframe):
    # function to create a graph for the alpha cash flow dataframe
    df1=dataframe 
    df1['date'] = df1.date.astype('datetime64[ns]')

    k_dims = [('date','Date')]
    val_dims = [('netincome', 'EBITDA')]

    plot_opts = dict(fill_color='#00AA00')

    df2 = hv.Table(df1,kdims=k_dims, vdims=val_dims)
    df3 = hv.Bars(df1,kdims=k_dims, vdims=val_dims)
    #df3 = hv.Bars(df1,kdims=k_dims, vdims=val_dims).opts(plot=plot_opts)
    #df3 = hv.Bars(df2).opts(plot=plot_opts)
    #df3 = hv.Bars(df2).opts(style=plot_opts)
    graph = hv.renderer('bokeh').server_doc(df3)

    return graph 

Any thoughts on this?

I looked through all the open and closed issues, and didn't see this one.
Hope we can figure it out.

Chad

@jbednar
Copy link
Member

jbednar commented Aug 16, 2017

Looks like there is a dependency on matplotlib being installed. Table might not need the colors module from matplotlib, but bars apparently does. Try conda installing matplotlib? We've eliminated most dependencies on matplotlib from the bokeh code, but I think there are still a few, deliberate or not.

@cnblevins
Copy link
Author

That was it.
Installed matplotlib 2.0.2 and hv.Bars now works.

Thanks.

@jbednar
Copy link
Member

jbednar commented Aug 16, 2017

Good. I'll leave this open, because it looks like we need to do some more tidying to avoid that requirement.

@jbednar jbednar changed the title Table, yes; Bars, no: renderer('bokeh').server_doc: 'NoneType' object has no attribute 'ColorConverter' plotting/bokeh/util.py depends on matplotlib even for bokeh backend Aug 17, 2017
@philippjfr philippjfr added this to the v1.10 milestone Mar 29, 2018
@philippjfr
Copy link
Member

This has now been fixed.

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 24, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants