NEW
Font size
WorksheetsMatplotlib Unit - 4
Total questions: 20
Worksheet time: 10mins
Which library is the most used visulization library in python?
Visual
Matlibplot
Matplotlib
matlab
Which function of matplotlib can be used to create a line chart?
Line
Plot
Graph
Bar
Which is not an accepted line style in matplotlib.
'-'
'--'
'-,'
'<'
Which graph should be used If we want to find patterns in data?
bar
histogram
scatterplots
basemap
To show the grid lines in plot, we can write _______________ #plt is an alias of matplotlib.pyplot
plt.grid( )
plt.grid(True)
Both of the above
plt
to add a title in the chart we use the function
title("title of the chart")
plt.title("title of the chart")
plt.title(title of the chart)
Which of the codes below should we use to rotate the data ticks on x-axis?
plt.xticks(rotation=30)
plt.ylabel(rotation=30)
plt.yticks(rotation=30)
plt.xlabel(rotation=30)
Which code should we use to display our graphs?
plt.display()
plt.graph()
plt.show()
plt.chart()
pyplot is also a python library.
False
True
This is an example of a ___________.
Scatter Chart
Line Graph
Bar Graph
Pie Chart
We can use matplotlib without installing the library.
True
False
df.plot( type = ‘hist’, edge = ‘red’)
df.plot( type = ‘hist’, line = ‘red’)
df.plot( type = ‘hist’, edgecolor = ‘red’)
df.plot(type = ‘hist’, linecolor = ‘red’)
How can you add a title to a Matplotlib plot?
By using the title() function
By using the label() function
By using the text() function
By using the legend() function
What is the purpose of the legend() function in Matplotlib?
To label the x and y axes of a plot
To add a title to a plot
To add annotations to a plot
To label different lines or markers on a plot
How do you set a title for the axis using matplotlib library?
ax.set_title("Axis Title")
ax.title("Axis Title")
ax.axis_title("Axis Title")
ax.setTitle("Axis Title")
Which of the following is correct code to plot line chart with dotted line style
plt.plot(x,y)
plt.linestyle = "dotted"
plt.show()
plt.plot(x,y)
plt.linestyle("dotted")
plt.show()
plt.plot(x,y,linestyle = "dotted")
plt.show()
All are correct
Which of the following is used to set the limit of x-axis of the plot?
Limit()
Limits()
Xlimit()
Xlimits()
By default hist() uses bin value of _______
5
10
15
20
To add complexity to the pie chart, you can draw it with a slice extracted from the pie.
shatter
explode
burst
inplode
_______ chart is characterized by a series of sectors that extend radially; each of these areas will occupy a certain angle.
3D surfaces
contour
pie
polar
