栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 面试经验 > 面试问答

图例在散景图中的位置

面试问答 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

图例在散景图中的位置

从Bokeh开始

0.12.4
,可以将图例放置在中央绘图区之外。这是用户指南中的简短示例:

import numpy as npfrom bokeh.models import Legendfrom bokeh.plotting import figure, show, output_filex = np.linspace(0, 4*np.pi, 100)y = np.sin(x)output_file("legend_labels.html")p = figure(toolbar_location="above")r0 = p.circle(x, y)r1 = p.line(x, y)r2 = p.line(x, 2*y, line_dash=[4, 4], line_color="orange", line_width=2)r3 = p.square(x, 3*y, fill_color=None, line_color="green")r4 = p.line(x, 3*y, line_color="green")legend = Legend(items=[    ("sin(x)",   [r0, r1]),    ("2*sin(x)", [r2]),    ("3*sin(x)", [r3, r4])], location=(0, -30))p.add_layout(legend, 'right')show(p)

要调整位置,变化

dx
dy
location=(dx, dy)



转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/634024.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号