Data visualization techniques for data analysis results
By: Jenny Fernandez
Tags: Data Science, Plotly, Sentiment Analysis, Twitter, Matplotlib

So, few days back, I was working on a sentiment analysis project, where I used to collect tweets/comments from various social networking platforms such as twitter, youtube, reddit and try to find out meaning out of it. It’s pretty interesting to have an overall view of what people think about a certain topic. Say for example, we can analyse, how many people are happy with the Avengers endgame, the final sequel of the Avengers series that was recently released or how many people were disappointed.

Once we have collected the data from various sources, there are various things we can infer out of it. Talking about the emotions, we can also categorize the comments into certain categories like happy, sad, anger, anxious (using the Plutchik’s piechart).

But, after performing this analysis, the main issue comes down to how to efficiently display the results. So this article, mainly focuses on the ways in which we can display our results in the most efficient way using various tools. We can display the results in the form of graphs or charts or by creating word clouds as well. Here we will mainly focus on the libraries or tools we can use to create graphs or charts efficiently.

Matplotlib

Matplotlib is a plotting library for the Python programming language and its numerical mathematics extension NumPy. There can be multiple usages of this library. We can embed matplotlib into GUIs like that of wxpython or PyQt and build applications. For plotting of sentiment analysis results, this was what I had used personally.

Plotting using Matplotlib

Matplotlib uses a module named pyplot for plotting by providing feature to control line styles, font properties, etc. It allows users to create different types of graphs such as histogram, bar charts, error charts, etc.

2. Tableau

Tableau is mostly famous among business analysts for charts visualization, but I found some really cool ways to represent sentiment analysis results using Tableau.

As you can see below, the below graph represents the number of tweets over a particular time duration. Also, it clearly represents how many of them were the actual tweets and how many of them were replies or retweets.

Its pretty easy to use. If you want to integrate it with Python, you can simply use the Tab.py library in order to use Tableau for python.

Number of tweets and retweets over time indicated using Tableau

Emotions categorized into various category using Tableau

Top 20 tweets depicted

3. Chartblocks

Bar graph creation using Chartblocks

Chartblock is an online tool used to create charts or graphs online, by simply uploading your data. You can also customize the charts according to your needs and later on, embed it into your website. And soon, the users will be able to connect directly to their data source or feeds.

4. DataWrapper

DataWrapper is another one such tool that allows easy creation of graphs without any coding. It is similar to Tableau but it does not support Dashboard creation and filtered views. Tableau serves REST API while DataWrapper does not. However, it is a cheaper option compared to Tableau.

5. Plot.ly

Average high and low temperature plotted using plotly

Plotly has its own online platform for creating charts, but it also offers its services that can be accessed from a Python Notebook. Plotly is used for making interactive plots, but its speciality is that it offers some charts you won’t find in most libraries, like contour plots, dendograms, and 3D charts.

6. Gleam

Plotting denoting how much beef was consumed in which time span

If you are someone who knows only python and no HTML or CSS, then this is the one for you. With the help of using only python scripts, you can build interactive graphs as shown above. Once you’ve created a plot, you can build fields on top of it so users can filter and sort data.

7. Seaborn

Plotting using Seaborn

Seaborn is built on the top of Matplotlib so you need to know Matplotlib in order to work with Seaborn. It offers a wide range of styles to be used from. Matplotlib and Seaborn are two important libraries used for data plotting in python.

8. Tweet Sentiment Visualisation

This is the best one that I could find, as it it very simple and easy to use. You simply input the keyword related to which you want the tweets to be fetched, it will directly fetch the data as well as plot it for you. However, this tool works only for Twitter.

The way they handle this is by looking for tweets based on the keyword and combining its pleasure rating to estimate the general sentiment.

Plotting using Tweet Sentiment Visualisation

You can refer the link below to have a better hands on experience of how it works:

https://www.csc2.ncsu.edu/faculty/healey/tweet_viz/tweet_app/

9. Bokeh

A histogram depicting how many no of flights were delayed by how much time

Unlike that of Matplotlib and Seaborn, Bokeh basically works with HTML and JavaScript. However, it is an equally powerful tool for creating graphs or charts. It helps us build web-based dashboards and applications easily.

So, as we saw, we can any of use these based on our requirements to create simple and interactive graphs.