python-3.xdata-visualizationdata-scienceholoviewschord-diagram

How to change labels font size in Holoviews chord diagram?


I'm trying to draw a chord diagram using HoloViews, and it seems to work fine, but I can't figure how to change labels font size. I tried changing fontscale value but it seems to have no effects on labels. Here is my code:

import pandas as pd
import holoviews as hv
from holoviews import dim, opts
hv.extension('bokeh')


chord = hv.Chord(temp) # temp is a pandas dataframe with cloumns=["from","to"]
chord.opts(fontscale=2, width=800, height=800, title='Collaborative Network')
chord.opts(
    opts.Chord(cmap='Category20', edge_cmap='Category20', edge_color=dim('to').str(), 
               labels='index', node_color=dim('index').str()))

Chord diagram of countries network


Solution

  • I resolved adding at the end of the code this: chord.opts(label_text_font_size='12pt')