简体   繁体   中英

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.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 ).

The setp machinery is just a convince method for looking up these functions. setp(artist, key=val) does, more-or-less getattr(artist, "set_%s" % key)(val) .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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