[英]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.我正在尝试使用 HoloViews 绘制和弦图,它似乎工作正常,但我不知道如何更改标签字体大小。 I tried changing fontscale value but it seems to have no effects on labels.
我尝试更改 fontscale 值,但它似乎对标签没有影响。 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')
我解决了在代码末尾添加:
chord.opts(label_text_font_size='12pt')
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.