Plotting in Python using Matplotlib
Data Visualization in Python – Multiple Choice Questions
Multiple Choice Questions – Set 3
41. Identify the correct statement to invoke plot() function, for making a line chart. import matplotlib.pyplot as plt #assume import statement is written.
a. plt.plot()
b. plot( [1,2,3], [2,5,4])
c. plt.plot( [1,3,4], [2,5,4])
d. None of these
42. Write a statement, to change the size of your plot to 18 units wide and 10 units long. [ import matplotlib.pyplot as plt #assume import statement is written ]
a. plt.figure(18,10)
b. plt.figure( figsize = (18, 10))
c. plt.figure(figsize = (10,18))
d. None of these
43. Write a statement, to show a grid on the plot. [ import matplotlib.pyplot as plt #assume import statement is written ]
a. plt.grid( )
b. plt.grid(True)
c. grid(True)
d. None of these
44. Write a statement, to change the color of a line to blue in a line chart.
import matplotlib.pyplot as plt
x = [2, 3.5, 1, 4]
y = [10, 12, 15, 9]
a. plt.plot(x, y, colour=’blue’ )
b. plt.plot(x, y, color = ‘b’)
c. plt.plot(x, y, ‘b’)
d. None of these
45. Write a statement, to change the width of line to 5 in a line chart.
import matplotlib.pyplot as plt
x = [2, 3.5, 1, 4]
y = [10, 12, 15, 9]
a. plt.plot(x, y, ‘blue’, linewidth = 5 )
b. plt.plot(x, y, color = ‘b’, linewidth = 5)
c. plt.plot(x, y, ‘b’, width = 5)
d. None of these
46. Which is the not valid line style?
a. solid ‘-‘
b. dashed ‘–‘
c. dotdash ‘.-‘
d. dotted ‘:’
47. Write a statement, to change the dotted line style of a line in line chart.
import matplotlib.pyplot as plt
x = [2, 3.5, 1, 4]
y = [10, 12, 15, 9]
a. plt.plot(x, y, ‘blue’, width = 5, linestyle=’-‘ )
b. plt.plot(x, y, color = ‘b’, linewidth = 5, ls= ‘-‘)
c. plt.plot(x, y, ‘b’, linewidth = 5, ls = ‘:’)
d. None of these
48. Can you change the marker type, size and its color in line chart?
a. Yes
b. No
49. Which argument of plot( ) function is use to change the marker type?
a. markertype
b. marker
c. markersize
d. None of these
50. Which argument of plot( ) function is use to change the marker size?
a. size
b. markerwidth
c. markersize
d. None of these
51. Which argument of plot( ) function is use to change the color of marker boundary i.e. edge?
a. markeredgecolor
b. markeredge
c. edgecolor
d. None of these
52. What is the default type of marker in line chart?
a. line type
b. circle marker
c. pointmarker
d. None of these
53. If you do not specify the marker type, then data points will _________ on the line chart.
a. marked
b. not marked
c. None of these
54. What is the default type of marker in line chart?
a. line type
b. circle marker
c. pointmarker
d. None of these
55. Write a statement, to change the marker type to diamond, marker size to 5 and marker edge color to green of a line chart.
import matplotlib.pyplot as plt
x = [2, 3.5, 1, 4]
y = [10, 12, 15, 9]
a. plt.plot(x, y, marker = ‘D’, size=5, markeredgecolor = ‘g’ )
b. plt.plot(x, y, marker = ‘D’, markersize = 5, markeredgecolor = ‘g’)
c. plt.plot(x, y, ‘b’, markertype = ‘D’, markersize = 5, markeredgecolor = ‘g’)
d. None of these
56. Can we combine the marker type and marker color together in line chart?
a. Yes
b. No
57. Which argument of plot( ) function is used to specify the marker color separately.
a. markercolor
b. color
c. markeredgecolor
d. None of these
58. plt.plot(x, y, ‘kh‘ linestyle = ‘solid’)
In the above statement, what is ‘k’ ?
a. marker type
b. line color
c. line width
d. None of these
59. plt.plot(x, y, ‘kh‘ linestyle = ‘solid’)
In the above statement, what is ‘h’ ?
a. marker type
b. line color
c. line width
d. None of these
60. plt.plot(x, y, ‘kh‘ linestyle = ‘solid’)
In the above statement, ‘k’ stands for which color ?
a. black
b. cyan
c. white
d. None of these
Class 12 Informatics Practices : Data Visualization – Plotting in Python MCQ’s
- Class 12 Informatics Practices Data Visualization using Python Matplotlib MCQ’s Set 1
- Class 12 Informatics Practices Data Visualization using Python Matplotlib MCQ’s Set 2
- Class 12 Informatics Practices Data Visualization using Python Matplotlib MCQ’s Set 3
- Class 12 Informatics Practices Data Visualization using Python Matplotlib MCQ’s Set 4
Class 12 Informatics Practices – Data Handling Using Pandas – I Multiple Choice Questions
Class 12 Informatics Practices Societal Impacts Multiple Choice Questions
- 200+ MCQ’s Class 12 Informatics Practices Unit 4 Societal Impacts Set 1
- 200+ MCQs Class 12 Informatics Practices Unit 4 Societal Impacts Set 2
- 200+ MCQs Class 12 Informatics Practices Unit 4 Societal Impacts Set 3
- 200+ MCQs Class 12 Informatics Practices Unit 4 Societal Impacts Set 4
- 200+ MCQs Class 12 Informatics Practices Unit 4 Societal Impacts Set 5
- 200+ MCQs Class 12 Informatics Practices Unit 4 Societal Impacts Set 6
- 200+ MCQs Class 12 Informatics Practices Unit 4 Societal Impacts Set 7
- 200+ MCQs Class 12 Informatics Practices Unit 4 Societal Impacts Set 8
- 200+ MCQs Class 12 Informatics Practices Unit 4 Societal Impacts Set 9
- 200+ MCQs Class 12 Informatics Practices Unit 4 Societal Impacts Set 10
Class 12 Informatics Practices : NCERT Exercise Solutions
- Class 12 Informatics Practices- Ch.1 Querying & SQL Function – NCERT Solution
- Class 12 Informatics Practices Data Handling using pandas – I NCERT Solution
- Class 12 Informatics Practices Chapter 3 Data Handling Using Pandas – II NCERT Exercise Solution
- Class 12 Informatics Practices Unit 4 Plotting Data using Matplotlib NCERT Exercise Solution
- Class 12 Informatics Practices Chapter 5 Internet and Web NCERT Exercise Solution
- Class 12 Informatics Practices Chapter 6 Societal Impacts NCERT Exercise Solution