如何解决旋转标签图案适合散景
当由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 举报,一经查实,本站将立刻删除。