Data visualizations in Python | R | Picture

Contents

Overview

  • A look at 11 Innovative and mind-blowing data visualizations in Python, R, Table y D3.js
  • These data visualizations cover a variety of real-world topics.
  • I have provided the open source code (u worksheet) for each visualization.

Introduction

“Visualization gives you answers to questions you didn't know you had”. – Ben Shneiderman

I have been involved in the data science field for a few years, but I come from a non-technical training (learning and development). It took me a while really transition to data science. Say “truly” because the first weeks were a whirlwind of changes (as I mention in detail in the structured thinking course for data science).

One of the biggest changes in my thinking revolved around how I looked at data. Initially, when my manager asked me to analyze certain data, used to create ordinary data visualizations (scatter diagrams, bar graphs, etc.). Little did I imagine the infinite possibilities that awaited me!

I can't relate to the Ben Shneiderman quote above. Truly mastering data visualization techniques opens doors and opportunities you haven't dreamed of before. A well-thought-out visualization peels off the layers that surround a raw dataset.

And that can often be the difference between a successful data science project and a mundane one..

data_visualization_python_r_tableau-9507285

Then, in this article, my goal is to show you the incredible power of data visualization. I have gathered 11 mind-blowing visualizations covering a variety of topics. And to show that you can do this in any tool of your choice, we will cover these visualizations in Python, R, Table y D3.js.

The challenge for you? Choose the display (code provided for all of them) and create your own version in the tool of your choice.

Data visualization in R

The creation of ggplot2 Library has made R the go-to tool for data visualization (At least for programmers!). I started my own data science journey using R and was instantly captivated by the beauty and power of ggplot.

Stylish displays, instant information, discovery patterns, all this in just a few lines of code. No wonder even expert Python programmers import ggplot2 into their Jupyter notebooks (Yes, that is possible now).

If you are using R and haven't explored ggplot2 still, make sure you do it TODAY:

Create BBC-style visualizations in R

r_data_visualization-2842167

This is not strictly a visualization, although it is certainly not a problem, truth? The panel above is a combination of visualizations published by the BBC data team. I have been following the BBC website for years, so this was a welcome release.

The BBC data team has developed and released an R package and R cookbook to generate visualizations like the one above.. The R package is called bbplot. Provides functions for creating and exporting visualizations made in ggplot in the style used by the BBC data team.

These are the key resources to follow your path:

Interactive charts in R

gganimate-2330393

Who doesn't enjoy interactive storylines? They are one of the most attractive aspects of a presentation (if used correctly). This visualization shows us how life expectancy has changed over the years on different continents, comparing it to GDP per capita.

So much information packed into such a small space. Is the package used to create the above visualization? gganimate! It is not surprising to see that the power of ggplot extends to another type of impressive display.

You can check out our guide to building interactive plots in R:

Sankey diagrams in R

r_data_visualization1-6554023

Intrigued? This is a classic example of a Sankey diagram. Basically, shows the flow of information, where the width of the arrows is proportional to the amount of flow. The above visualization shows the relevance of Facebook Custom List Advertising.

This visualization was created using the ggaluvial R package. Combines the style and flexibility of the original alluvial pack with the power of tidyverse.

You can find the complete code, consisting of a few lines. here.

Data visualization in Tableau

"In a good visualization of the information, no rules, guidelines, templates, standard technologies or style books. You just have to do whatever it takes “. – Edward Tufte

Edward Tufte is a pioneer in the field of data visualization. Sorry for this quote Really applies to visualizations we generate with Tableau. The plethora of features and customizations Tableau offers is almost unmatched.

If you are interested in getting started with Tableau, You have come to the right place! Then, you will find a series of articles to help you go from a beginner to a Tableau expert:

The largest vote in the world: Indian elections displayed

data_visualization_tableau-4365383

This is a really impressive visualization. I have only taken part of the whole board. The scope of this visualization and the amount of data covered is staggering and really useful for anyone interested in this type of analysis..

Each data point represents details about each seat, including the name of the winner, the state, the party and the constituency). Look at how neat this visualization is, despite packing a lot of information. This is something we can all aspire to in our daily report / weekly / monthly, truth?

Here's the full Tableau dashboard what can you download.

Monitor sales performance with Tableau

tableau_data_visualization-5523760

I wanted to include a real world business panel. If you are struggling to visualize where you can use these visualizations in the real world (Use your imagination!), This will be very useful to you.

This is an analysis of the sales data to measure the distance from the original quota. I especially liked the first horizontal tab that clearly summarized the key figures that a customer or stakeholder needs to know.

the full Tableau workbook contains five comprehensive panels that analyze these sales figures from different perspectives. I really think you should use this as a reference if you work in the sales or marketing field.

Popularity of the film genre – 1910-2018

data_visualization_python_film_genre-4253414

I am a huge movie buff, so this visualization instantly drew my attention to Tableau's public gallery. Please note that this is the popularity of film genres. overtime. Each genre has a different axis range, Thus, look at them from that lens (instead of a one-on-one comparison).

What caught my eye is that you can think of this as a dashboard with multiple data points presented. Can you think of a similar use case in your professional life where such a dashboard would be helpful?

You can download the full worksheet and play with it in Tableau.

Data visualization in D3.js

If you want to create amazing animated visualizations, D3.js should be your reference tool. It is a powerful library that allows you to create custom visualizations for any type of storytelling you can imagine for the web..

This section is perhaps my favorite of the four that we have covered in this article.. You should seriously consider adding D3.js to your skill set, especially if you want to work with data visualization regularly.

Here are two popular articles on getting started with D3.js:

Conceptual map – Relationship between concepts

concept_map-3292842

I use a concept map quite often. I can easily represent the relationships between different concepts or knowledge points. As Wikipedia says, “A concept map generally represents ideas and information as boxes or circles., connecting with labeled arrows in a hierarchical structure that branches down”.

You will find it useful for mapping business decisions, process flow diagrams, information design, knowledge visualization, among other things. It is an underrated but useful tool to have in your arsenal.

This concept map it is very interactive and you can also play with the different nodes.

Viewing Sunburst Sequences in D3.js

sequence_sunburst_visualization_d3js-7071722

¡Ah, genial! This visualization shows how to use the concept of sunrays with data describing the sequence of events.

Think about it: you can visualize your customer journey with this. Instead of a static funnel, you can see all possible routes using this visualization. Your marketing team will love that you implement it. 🙂

The complete D3.js code to generate this sequence sunburst is here.

Visualization of the interaction between Game of Thrones characters

screen-shot-2017-08-26-at-16-32-581-9762094

Are you a fan of Game of Thrones? Then you will love this visualization. Represents the influence of each character based on the number of times their interaction has appeared in the book “A Storm of Swords”.

Note that the nodes represent the characters and the links the interaction between them. The size of the node and the name represents the influence of the character. It's no wonder Tyrion has the most influence, truth?

You can create your own Game of Thrones visualization using this tutorial.

Data visualization in Python

We often think of Python as the ultimate programming language for data science. We associate it with data cleansing, building predictive models and even certain data engineering tasks. But did you know that Python is quite useful for generating data visualizations?

That's how it is, Python comes with two exclusive libraries for visualization: matplotlib y seaborn. You can refer to this article to know more about these libraries and see them in action.

A geological map of Mars

data_visualization_python_mars-2052802

This visualization is a beauty. I came across this geological map of Mars a few days ago and it still amazes me that it was created in Python (with a little help from Adobe Illustrator). Amazing!

The Python libraries used to create this wonderful visualization are:

  • Matplotlib
  • NumPy
  • Pandas
  • Cartopy

If the font is too small to read or if you want to print it as a poster, get the full high resolution image. here. And you can get the python code for this visualization. here. The GitHub repository has the full tutorial to get started.

Plotting geostationary satellites in Python

I'm fascinated by the research our data science community is doing on satellite data. We have seen the discovery of new planets, the recreation of images at ground level, NASA earthquake prediction, among other things.

the PyEphem Package was used to create this awesome plot in Python. PyEphem basically allows us to implement astronomical algorithms in Python.

A good number of data science enthusiasts tried to plot this visualization and you can find all the resources. here.

Final notes

I had so much fun putting together this list. I work mainly with R and Tableau, so it was revealing to see the kind of visualizations we can generate using D3.js. I will definitely try my luck there.

Is there a visualization that you have come across that has blown your mind? Go ahead and share them with us in the comment section below. This is the best place to get creative and learn from the community!!

Subscribe to our Newsletter

We will not send you SPAM mail. We hate it as much as you.