NEW
Font size
WorksheetsMatplotlib MCQ Questions
Total questions: 30
Worksheet time: 15mins
What is Matplotlib in Python?
A plotting library
A machine learning library
A data manipulation library
A web development library
Which function is used to create a simple line plot in Matplotlib?
plot()
line()
draw()
scatter()
What is the default backend used by Matplotlib?
TkAgg
Qt5Agg
WebAgg
GTK3Agg
Which command is used to display the plot on the screen?
show()
display()
render()
plot()
How can you set the title of a plot?
title()
set_title()
plot_title()
add_title()
What does the function 'xlabel()' do in Matplotlib?
Sets the x-axis label
Sets the y-axis label
Adds a title
Adds a legend
Which function is used to create a scatter plot?
scatter()
plot()
dot()
point()
How can you change the line style in a plot?
linestyle='--'
line='--'
style='--'
stroke='--'
Which method adds a legend to the plot?
legend()
add_legend()
plot_legend()
show_legend()
How can you save a plot as an image?
savefig()
save_image()
export()
plot_save()
Which module within Matplotlib is used for 3D plotting?
mplot3d
pyplot3D
mpl3d
matplotlib3D
How can you plot multiple subplots in a single figure?
subplot()
multiple()
grid()
plot_multiple()
Which argument controls the color of a line plot?
color
linecolor
plot_color
fill_color
What is the default marker used in the 'plot()' function?
None
'o'
'.'
'*'
Which method is used to set the limits of the x-axis?
xlim()
set_xlim()
axis_limit()
range_x()
What does the 'grid()' function do?
Adds gridlines to the plot
Creates subplots
Adds labels
Saves the plot
Which function creates a bar plot?
bar()
plot()
scatter()
line()
How can you rotate the tick labels on the x-axis?
xticks(rotation=45)
xlabel(rotation=45)
rotate_ticks(45)
ticklabel_rotate()
Which function adds annotations to a plot?
annotate()
add_text()
text()
label()
How do you create a pie chart using Matplotlib?
pie()
chart()
plot_pie()
piechart()
Which parameter in 'plot()' sets the line width?
linewidth
thickness
stroke
weight
How can you display logarithmic scale on the y-axis?
set_yscale('log')
yscale='log'
log_y()
logscale_y()
What function can be used to create a histogram?
hist()
bar()
scatter()
plot()
How can you fill the area under a curve?
fill_between()
fill_curve()
area_fill()
curve_fill()
Which function allows customizing tick marks?
tick_params()
set_ticks()
customize_ticks()
adjust_ticks()
What does 'alpha' parameter control in plots?
Transparency
Line style
Line width
Marker size
How can you set the background color of a plot?
set_facecolor()
bgcolor()
plot_color()
facecolor()
Which function is used to create a horizontal bar plot?
barh()
bar_horizontal()
hbar()
horizontal_bar()
What is the purpose of 'tight_layout()' in Matplotlib?
Adjusts subplot spacing
Fixes axis limits
Changes plot size
Sets title alignment
Which function plots the cumulative distribution of data?
ecdf()
plot_cdf()
cumulative()
hist(cumulative=True)
