旋转标签图案适合散景

问题描述

当由bokeh标签放置时,标签会适合图形(画布),但旋转时该功能将不起作用。

from bokeh.models import ColumnDataSource,Label,LabelSet,Range1d
from bokeh.plotting import figure,output_file,show

output_file("label.html",title="label.py example")

source = ColumnDataSource(data=dict(height=[66,71,72,68,58,62],weight=[165,189,220,141,260,174],names=['Mark','Amir','Matt','Greg','Owen','Juan']))

p = figure(title='dist. of 10th Grade Students at Lee High',x_range=Range1d(140,275))
p.scatter(x='weight',y='height',size=8,source=source)
p.xaxis[0].axis_label = 'Weight (lbs)'
p.yaxis[0].axis_label = 'Height (in)'

# Fitted data
citation1 = Label(x=260,y=58,text='Fitted data even to figure',render_mode='css',border_line_color='black',border_line_alpha=1.0,background_fill_color='white',background_fill_alpha=1.0,)

#Unfitted data
citation2 = Label(x=165,y=52,text='Unfitted data,get out of canvas',render_mode='canvas',angle = 90,angle_units='deg')


p.add_layout(citation1)
p.add_layout(citation2)

show(p)

有什么主意如何制作可以始终显示在图中的旋转标签

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)