Lab10S DataViz
Lab10S DataViz
The above statements are the learning outcomes of this laboratory and will be achieved in concert
with the other learning activities that you undertake for this unit.
2. Create the following graphics as described in the following sub-questions, ensuring that you
configure the use of Matplotlib in such a way that all requirements of the sub-question are met:
a. A scatter plot, comparing displacement and horsepower for all vehicles, with each scatter
plot blue in colour and with an appropriate title and axis labels;
b. A bar chart, comparing the average quarter mile time for cars from each of the countries
of origin, with the bars red in colour and with an appropriate title and axis labels;
c. A pie chart, showing the proportion of vehicles in the sample (as a percentage) for each
of the different values of cylinders represented, with each of the pie segments a different
colour and with an appropriate title and labels;
d. A histogram, showing the frequency of cars within the dataset by the number of
carburettors that the vehicle has, with the bars coloured green and with appropriate title
and axis labels;
e. A line chart, showing the number of sales for each vehicle compared to the horsepower
of the vehicle, with the line coloured purple and appropriate axis labels and titles
included;
f. The most appropriate of a bar chart or a histogram, showing the frequency of each make
within the dataset (Hint: consider the first word of the model the make) with the bars
coloured yellow, with an appropriate title and axis labels.