The plot function of pandas matplotlib uses 'kind' argument which can accept a string indicating the type of graph to be plotted. Which of the following are valid plots?
(A) Area
(B) Box
(C) Scatter
(D) Line
The plot function of pandas matplotlib uses 'kind' argument which can accept a string indicating the type of graph to be plotted. Which of the following are valid plots?
(A) Area
(B) Box
(C) Scatter
(D) Line
Solution
All four are valid values of the kind argument in pandas plot(): 'area', 'box', 'scatter' and 'line'.
The full list of accepted strings is 'line' (default), 'bar', 'barh', 'hist', 'box', 'kde' or 'density', 'area', 'pie', 'scatter' and 'hexbin'.
Options 1, 2 and 4 each leave out one valid kind. The one students most often drop is 'scatter', because it works only on a DataFrame and needs both x and y, for example df.plot(kind='scatter', x='a', y='b'). It is still a valid kind.
Related questions:
2026: 18 May Shift 2
2026: 20 May Shift 1
2026: 21 May Shift 1