English

What effect did ‘legend=False’ in the program have on the output? import pandas as pd import matplotlib.pyplot as plt df=pd.DataFrame({'GeoArea':[83743,78438,22327,22429,21081,16579,10486]

Advertisements
Advertisements

Question

What effect did ‘legend=False’ in the program have on the output?

import pandas as pd
import matplotlib.pyplot as plt
df=pd.DataFrame({'GeoArea':[83743,78438,22327,22429,21081,16579,10486]
     ,'ForestCover':[67353,27692,17280,17321,19240,13464,8073]},
      index=['Arunachal Pradesh','Assam','Manipur','Meghalaya'
    ,'Mizoram','Nagaland','Tripura'])
df.plot(kind='pie',y='ForestCover',title='Forest cover of North Eastern
states',legend=False)
plt.show()
Very Short Answer
Advertisements

Solution

legend=False removes the legend from the pie chart output. Therefore, no legend is displayed in the graph, making the chart appear without a legend box.

shaalaa.com
  Is there an error in this question or solution?
Chapter 4: Plotting Data using Matplotlib - Intext Questions [Page 132]

APPEARS IN

NCERT Informatics Practices [English] Class 12
Chapter 4 Plotting Data using Matplotlib
Intext Questions | Q 8. | Page 132
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×