पाई चार्ट को सुथरा बनाना
पिछले प्लॉट में बनाया गया आपका पाई चार्ट अच्छा है, लेकिन थोड़ा भरा-भरा लग रहा है. आइए इसे ggplot के theme_void() फंक्शन से साफ-सुथरा करें और ggtitle(...) से एक सार्थक टाइटल भी दें.
पिछले अभ्यास का summarized डेटा फ्रेम disease_counts आपके लिए पहले से लोड है.
यह अभ्यास पाठ्यक्रम का हिस्सा है
R में Visualization की Best Practices
अभ्यास निर्देश
- बैकग्राउंड साफ करने के लिए ggplot ऑब्जेक्ट में
theme_void()जोड़ें. - प्लॉट का टाइटल
'Proportion of diseases'दें.
इंटरैक्टिव व्यावहारिक अभ्यास
इस अभ्यास को इस नमूना कोड को पूरा करके आज़माएँ।
ggplot(disease_counts, aes(x = 1, y = total_cases, fill = disease)) +
# Use a column geometry.
geom_col() +
# Change coordinate system to polar.
coord_polar(theta = "y") +
# Clean up the background with theme_void and give it a proper title with ggtitle.
___ +
___