मराठी
तामिळनाडू बोर्ड ऑफ सेकेंडरी एज्युकेशनएचएससी विज्ञान इयत्ता १२

Write the difference between the following functions: plt.plot([1,2,3,4]), plt.plot([1,2,3,4], [1,4,9,16]). - Computer Science

Advertisements
Advertisements

प्रश्न

Write the difference between the following functions: plt.plot([1,2,3,4]), plt.plot([1,2,3,4], [1,4,9,16]).

फरक स्पष्ट करा

उत्तर

  plt.plot([I,2,3,4]) plt.pIot([I,2,3,4],[1,4,9,16])
1 In plt.plot([1,2,3,4]) a single list or array is provided to the plot() command. In plt.pIot([1,2,3,4],[l,4,9,16]) the first two parameters are ‘x’ and ‘y’ coordinates.
     
2 matplotlib assumes it is a sequence of y values, and automatically generates the x values. This means we have 4 co-ordinate according to these ‘list as (1,1), (2,4), (3,9), and (4,16).
3 Since python ranges start with 0, the default x vector has the same length as y but starts with 0. Hence the x data are [0,1,2,3].  
shaalaa.com
Special Plot Types
  या प्रश्नात किंवा उत्तरात काही त्रुटी आहे का?
पाठ 16: Data visualization using pyplot: line chart, pie chart and bar chart - Evaluation [पृष्ठ ३३३]

APPEARS IN

सामाचीर कलवी Computer Science [English] Class 12 TN Board
पाठ 16 Data visualization using pyplot: line chart, pie chart and bar chart
Evaluation | Q 5. | पृष्ठ ३३३
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×