Reputation: 810
I want to hide one wedge of a pie chart in Matplotlib, but there does not seem to be an option for it in the parameters.
I guess it would be possible to give one bar the same color as the background but that doesn't feel like a reliable solution. Is there a better way?
Upvotes: 1
Views: 585
Reputation: 25053
You can manipulate the visibility of any WEDGE in your pie chart. E.g.,
In [36]: import matplotlib.pyplot as plt
...: import numpy as np
...: data = np.arange(5.0)+2.0
...: wedges, labels = plt.pie(data, labels=['a','b','c','d','e'])
...: wedges[3].set_visible(False)
...: plt.show()
Upvotes: 3