简体   繁体   中英

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()))

国家网络和弦图

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM