मराठी

What would happen if we use df.plot(kind=’scatter’) instead of plt.scatter() in the program?

Advertisements
Advertisements

प्रश्न

What would happen if we use df.plot(kind=’scatter’) instead of plt.scatter() in the program?

import numpy as np
import matplotlib.pyplot as plt
discount= np.array([10,20,30,40,50])
saleInRs=np.array([40000,45000,48000,50000,100000])
size=discount*10
plt.scatter(x=discount,y=saleInRs,s=size,color='red',linewidth=3,m
arker='*',edgecolor='blue'
plt.title('Sales Vs Discount')
plt.xlabel('Discount offered')
plt.ylabel('Sales in Rs')
plt.show()
लघु उत्तर
Advertisements

उत्तर

If df.plot(kind='scatter') is used instead of plt.scatter(), the scatter plot will be created using the Pandas DataFrame. It requires specifying the x and y columns of the DataFrame, whereas plt.scatter() plots are directly from arrays. The output remains a scatter plot.

shaalaa.com
  या प्रश्नात किंवा उत्तरात काही त्रुटी आहे का?
पाठ 4: Plotting Data using Matplotlib - Intext Questions [पृष्ठ १२५]

APPEARS IN

एनसीईआरटी Informatics Practices [English] Class 12
पाठ 4 Plotting Data using Matplotlib
Intext Questions | Q 5. | पृष्ठ १२५
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×