Portfolio Week 4: Introduction to Data Science: Displaying Line, Bar, Pie and Scatter Charts
- Goh Qi Xun

- Dec 1, 2019
- 2 min read
In this exercise, I will be plotting and manipulating line, bar, pie and scatter charts using "Matplotlib" library, a plotting library for the Python programming language and its numerical mathematics extension NumPy.
I will be running this my python program on jupyter notebook.
The first line graph I created. Based on the graph, it shows that this student result is dropping. The peak of the student was in semester 2 as the grade was the highest.

Width of the line is increased to enhance visibility.

Another data is added to the line graph. The line is in orange, make it visually better to compare between data.
In my opinion, I think this chart is trying to compare the result between two students. The student in the orange line has improved as the blue is de-proving. The peak of the second student is Semester 8.

The labels were added to represent their names in the line chart. The legend() function uses the label argument supplied in the plot() function as the legend entries.

BAR CHART
A bar chart has an almost similar type of code to plot. In this chart, the grid is added for better visibility. Alignment is needed to make the chart at the center.

Adding another Bar to the Chart
In the Bar Chart, adding another bar will make the both the data overlap each other. Personally, I prefer this type of chart over the line chart.

Changing the x-axis label

PIE CHART
Pie Chart looks much simpler to make compared to the previous chart I tried. The pie chart is useful to visualize the percentage of each segment instead of the numbers.

Scatter Plots

Combining Scatter Plots

Through this experience, I have learned how to make a plot and manipulate a chart. I think this is very important when it comes to visualizing data and doing machine learnings.



Comments