Spines हटाना
आम तौर पर, विज़ुअलाइज़ेशन में फालतू निशानों को कम से कम रखना चाहिए ताकि डेटा खुद बोल सके। Seaborn आपको ऊपर, नीचे, बाएँ और दाएँ axis पर बनी रेखाएँ हटाने देता है, जिन्हें अक्सर spines कहा जाता है.
यह अभ्यास पाठ्यक्रम का हिस्सा है
इंटरमीडिएट Data Visualization with Seaborn
अभ्यास निर्देश
- प्लॉट के लिए
whiteस्टाइल का उपयोग करें. pop2010औरfmr_2कॉलम की तुलना करते हुए एकlmplot()बनाएँ.despine()का उपयोग करके ऊपर और दाएँ spines हटाएँ.
इंटरैक्टिव व्यावहारिक अभ्यास
इस अभ्यास को इस नमूना कोड को पूरा करके आज़माएँ।
# Set the style to white
sns.set_style('____')
# Create a regression plot
sns.lmplot(data=df,
x='pop2010',
y='fmr_2')
# Remove the spines
sns.____()
# Show the plot and clear the figure
plt.show()
plt.clf()