Chord Graph with Holoviews: Troubles concerning adding colors and labels

477 Views Asked by At

I've tried to plot a chord graph according to http://holoviews.org/reference/elements/bokeh/Chord.html#elements-bokeh-gallery-chord Nonetheless, I'm receiving a graph lacking labels and colors, which is totally different from the picture shown on the website:
enter image description here

The following is my code.

import pandas as pd
import holoviews as hv
from holoviews import opts, dim
from bokeh.sampledata.les_mis import data

hv.extension('bokeh')
hv.output(size=200)

links = pd.DataFrame(data['links'])
nodes = hv.Dataset(pd.DataFrame(data['nodes']), 'index')

chord = hv.Chord((links, nodes)).select(value=(5, None))
chord.opts(opts.Chord(labels='name', 
                       cmap='Category20', 
                       edge_cmap='Category20', 
                    node_color=dim('name').str()))


mr = hv.renderer('matplotlib')
mr.show(chord)

Any suggestion will be much appreciated.

0

There are 0 best solutions below