简体   繁体   English

在matplotlib中设置Circle Patch的颜色?

[英]Setting color of Circle Patch in matplotlib?

Setting the color or a Circle patch directly is not supported through class methods as we might assume; 我们可能会假设,通过类方法不支持直接设置颜色或Circle补丁。

circle.set_color('b') 

^^ this is incorrect. ^^这是不正确的。

Patches have two distinct colors, facecolor and edgecolor , which you can set by, respectively c.set_facecolor(...) (or set_fc ) and c.set_edgecolor(...) (or set_ec ). 色块具有两种不同的颜色, facecoloredgecolor ,可以分别通过c.set_facecolor(...) (或set_fc )和c.set_edgecolor(...) (或set_ec )进行设置。

The setp machinery is just a convince method for looking up these functions. setp机制只是查找这些功能的一种有说服力的方法。 setp(artist, key=val) does, more-or-less getattr(artist, "set_%s" % key)(val) . setp(artist, key=val)或多或少会出现getattr(artist, "set_%s" % key)(val)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM