CBSE Class 12 Informatics Practices Question 11 of 147

Plotting with Pyplot — Question 5

Back to all questions
5
Question

Question 5

Which argument will you provide to change the following in a line chart ?

(i) width of the line

(ii) color of the line

Answer

(i) For changing the width of the line, we use the linewidth argument with the plot() function as: <matplotlib.pyplot>.plot(<data1>, [,data2], linewidth = <width> )

(ii) For changing the color of the line, we use the color argument with the plot() function as: <matplotlib.pyplot>.plot(<data1>, [,data2], <color code>)