0

这是一个很容易回答的问题,我敢肯定。我正在使用 bqplot(带有 pyplot),默认情况下,图例是带框的。所以我的问题是:如何移除框架?使用 matplotlib,我知道我可以简单地使用 plt.legend(frameon=False),你知道 bqplot 的直接等价物吗?

这段代码如下所示:

import bqplot.pyplot as pl

plot_test = pl.figure()
test = pl.plot(x,y, colors = ["white"],labels=['blabla'])
pl.legend()
pl.show()

先感谢您!

4

1 回答 1

1

删除边框最简单的方法是将图例边框宽度更改为 0。

plot_test.legend_style = {'stroke-width': 0}

在此处输入图像描述

Bqplot 图例样式使用 SVG CSS 样式属性。其他图例样式示例包括.....

plot_test.legend_style = {
    'fill': 'white'  ,
    'stroke' : 'blue' ,
    'stroke-width':3,
    'opacity':0.7   
                  }
于 2019-09-19T09:49:23.287 回答