हिंदी

On providing a single list or array to the plot() function, can matplotlib generate values for both the x and y axiz?

Advertisements
Advertisements

प्रश्न

On providing a single list or array to the plot() function, can matplotlib generate values for both the x and y axiz?

लघु उत्तरीय
Advertisements

उत्तर

  • Yes, when only a single list or array is provided to the plot() function, Matplotlib automatically generates the values for the x-axis.
  • The given list values are taken as y-axis values, and the x-axis values are generated automatically starting from 0.
import matplotlib.pyplot as plt
plt.plot([10, 20, 30, 40])
plt.show()
shaalaa.com
  क्या इस प्रश्न या उत्तर में कोई त्रुटि है?
अध्याय 4: Plotting Data using Matplotlib - Intext Questions [पृष्ठ १०९]

APPEARS IN

एनसीईआरटी Informatics Practices [English] Class 12
अध्याय 4 Plotting Data using Matplotlib
Intext Questions | Q 1. | पृष्ठ १०९
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×