config.py 文件源码

python
阅读 19 收藏 0 点赞 0 评论 0

项目:haller 作者: bharat 项目源码 文件源码
def plot(a):
    panels = a.rotated_panel_positions
    x = [x['x'] for x in panels]
    y = [x['y'] for x in panels]
    ids = [x['panelId'] for x in panels]
    angles = [x['o'] for x in panels]

    pad_x = (max(x) - min(x)) * .1
    pad_y = (max(y) - min(y)) * .1
    output_file('plot.html')
    plot = figure(x_range=(min(x) - pad_x, max(x) + pad_x),
                  y_range=(min(y) - pad_y, max(y) + pad_y))
    source = ColumnDataSource(dict(x=x, y=y, text=ids))
    plot.triangle(x, y, angle=angles, angle_units='deg', size=70, color='#cccccc', fill_color=None, line_width=4)
    glyph = Text(x='x', y='y', text='text', angle=0, text_align='center', text_color='#FF0000')
    plot.add_glyph(source, glyph)
    show(plot)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号