Python图表-更改轴标记颜色和图例边框颜色
我正在使用 Python 绘制几个图表,并尝试更改格式并从本质上对图表进行“品牌化”。我已经设法使用 pylab.rcParams[...] 更改了大多数内容,但我无法弄清楚如何更改轴上标记的颜色和图例周围的边框。任何帮助将不胜感激。下面的行是我用来编辑其他部分的代码类型的示例。基本上只是从 matplotlibrc 中获取的行,但我找不到它们来改变我想要的一切。
pylab.rcParams[axes.labelcolor' = '#031F73'
I'm using Python to plot a couple of graphs and I'm trying to change the formatting and essentially 'brand' the graph. I've managed to change most things using pylab.rcParams[...], but I can't work out how to change the colour of the markers on the axes and the border around the legend. Any help would be much appreciated. The line below is an example of the type of code I've been using to edit other parts. Basically just lines taken from matplotlibrc, but I can't find them to change everything I want.
pylab.rcParams[axes.labelcolor' = '#031F73'
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您只想使用
rcParams
,正确的参数是xticks.color
和yticks.color
。我似乎找不到图例框架颜色的关键。不过,您可以通过编程方式进行设置(以及刻度线颜色)。If you just want to use
rcParams
, the proper parameters arexticks.color
andyticks.color
. I can't seem to find a key for the legend frame color. You can set that (along with the tick colors) programmatically though.