मैटप्लॉटलिब पाई चार्ट में बाईं ओर का लेबल हटाने के लिए, हम निम्नलिखित चरण अपना सकते हैं:
घंटे, गतिविधियों, और रंगों की सूचियाँ बनाएं।
pie() मेथड का उपयोग करके पाई चार्ट प्लॉट करें।
मैटप्लॉटलिब में बाईं ओर का लेबल छिपाने के लिए, हम खाली स्ट्रिंग के साथ plt.ylabel("") का उपयोग कर सकते हैं।
उदाहरण
import matplotlib.pyplot as plt
plt.rcParams["figure.figsize"] = [7.00, 3.50]
plt.rcParams["figure.autolayout"] = True
hours = [8, 1, 11, 4]
activities = ['sleeping', 'exercise', 'studying', 'working']
colors = ["grey", "green", "orange", "blue"]
plt.pie(hours, labels=activities, colors=colors, autopct="%.2f")
plt.ylabel("")
plt.show()
आउटपुट
