andrewRowlinson / mplsoccer

Football pitch plotting library for matplotlib
MIT License
405 stars 82 forks source link

Color documentation #99

Closed Heissberg closed 11 months ago

Heissberg commented 1 year ago

Where can I find detailed documentation on facecolor argument of Radar.draw_circle method ?

andrewRowlinson commented 1 year ago

draw_circles uses a PatchCollection:

https://matplotlib.org/stable/api/collections_api.html#matplotlib.collections.PatchCollection

The kwargs are forwarded to Collection: https://matplotlib.org/stable/api/collections_api.html#matplotlib.collections.Collection

Collection allows you to use the plurals: facecolors, edgecolors, linewidths and linestyles. So you could set each circle to have different styles.

If you use the singular versions, e.g. facecolor as kwargs then they are forwarded to Wedge. In that case all of the circles will have the same style: https://matplotlib.org/stable/api/_as_gen/matplotlib.patches.Wedge.html

For specifying colors see the following Matplotlib guide: https://matplotlib.org/stable/users/explain/colors/colors.html#sphx-glr-users-explain-colors-colors-py

If you do not want any color you can use 'None' in quotes as the color.