Home » Python8 February 2016

Python: Graph plotting with Matplotlib (Bar Chart)

This article deals with plotting line graphs with Matplotlib (a Python’s library).

Below is the data which we will use to plot the bar chart. The data is saved in a CSV file named result3-blog.csv.

f1-user-ratingf1-review-ratingf1-combined-rating
0.67846259940.67659372470.6948878326
0.72848327690.72464271770.7226608468
0.63120794080.62945110580.6367180825

As seen above, the CSV file contains result in terms of F1 measure which is an accuracy measure generally used to evaluate Machine Learning experiments. We have F1 score from three different sets of experiments,

a) while using user rating
b) while using review rating
c) while using combined rating

We have evaluated each experiment 3 times. Hence, there are three rows of value data.

The details about these three experiments is not much of value over here. We can directly concentrate on the data shown above.

Here is the full Python & Matplotlib code to plot the bar chart:

Here is the image of graph/chart drawn:

bar chart matplotlib

Hope this helps.
Thanks.

Python

Get New Post by Email

Find me on

FacebookTwitterGoogle+LinkedInRSS Feed