Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying The Data Visualization Workshop
  • Table Of Contents Toc
The Data Visualization Workshop

The Data Visualization Workshop

By : Mario Döbler , Tim Großmann , Rohan Chikorde, Joshua Görner, Anshu Kumar , Piotr Malak, Ankit Verma
4 (1)
close
close
The Data Visualization Workshop

The Data Visualization Workshop

4 (1)
By: Mario Döbler , Tim Großmann , Rohan Chikorde, Joshua Görner, Anshu Kumar , Piotr Malak, Ankit Verma

Overview of this book

Do you want to transform data into captivating images? Do you want to make it easy for your audience to process and understand the patterns, trends, and relationships hidden within your data? The Data Visualization Workshop will guide you through the world of data visualization and help you to unlock simple secrets for transforming data into meaningful visuals with the help of exciting exercises and activities. Starting with an introduction to data visualization, this book shows you how to first prepare raw data for visualization using NumPy and pandas operations. As you progress, you’ll use plotting techniques, such as comparison and distribution, to identify relationships and similarities between datasets. You’ll then work through practical exercises to simplify the process of creating visualizations using Python plotting libraries such as Matplotlib and Seaborn. If you’ve ever wondered how popular companies like Uber and Airbnb use geoplotlib for geographical visualizations, this book has got you covered, helping you analyze and understand the process effectively. Finally, you’ll use the Bokeh library to create dynamic visualizations that can be integrated into any web page. By the end of this workshop, you’ll have learned how to present engaging mission-critical insights by creating impactful visualizations with real-world data.
Table of Contents (9 chapters)
close
close
Preface
7
7. Combining What We Have Learned

Comparison Plots

Comparison plots include charts that are ideal for comparing multiple variables or variables over time. Line charts are great for visualizing variables over time. For comparison among items, bar charts (also called column charts) are the best way to go. For a certain time period (say, fewer than 10-time points), vertical bar charts can be used as well. Radar charts or spider plots are great for visualizing multiple variables for multiple groups.

Line Chart

Line charts are used to display quantitative values over a continuous time period and show information as a series. A line chart is ideal for a time series that is connected by straight-line segments.

The value being measured is placed on the y-axis, while the x-axis is the timescale.

Uses

  • Line charts are great for comparing multiple variables and visualizing trends for both single as well as multiple variables, especially if your dataset has many time periods (more than 10).
  • For smaller time periods, vertical bar charts might be the better choice.

The following diagram shows a trend of real estate prices (per million US dollars) across two decades. Line charts are ideal for showing data trends:

Figure 2.1: Line chart for a single variable

Figure 2.1: Line chart for a single variable

Example

The following figure is a multiple-variable line chart that compares the stock-closing prices for Google, Facebook, Apple, Amazon, and Microsoft. A line chart is great for comparing values and visualizing the trend of the stock. As we can see, Amazon shows the highest growth:

Figure 2.2: Line chart showing stock trends for five companies

Figure 2.2: Line chart showing stock trends for five companies

Design Practices

  • Avoid too many lines per chart.
  • Adjust your scale so that the trend is clearly visible.

    Note

    For plots with multiple variables, a legend should be given to describe each variable.

Bar Chart

In a bar chart, the bar length encodes the value. There are two variants of bar charts: vertical bar charts and horizontal bar charts.

Use

While they are both used to compare numerical values across categories, vertical bar charts are sometimes used to show a single variable over time.

Don’ts of Bar Charts

  • Don’t confuse vertical bar charts with histograms. Bar charts compare different variables or categories, while histograms show the distribution for a single variable. Histograms will be discussed later in this chapter.
  • Another common mistake is to use bar charts to show central tendencies among groups or categories. Use box plots or violin plots to show statistical measures or distributions in these cases.

Examples

The following diagram shows a vertical bar chart. Each bar shows the marks out of 100 that 5 students obtained in a test:

Figure 2.3: Vertical bar chart using student test data

Figure 2.3: Vertical bar chart using student test data

The following diagram shows a horizontal bar chart. Each bar shows the marks out of 100 that 5 students obtained in a test:

Figure 2.4: Horizontal bar chart using student test data

Figure 2.4: Horizontal bar chart using student test data

The following diagram compares movie ratings, giving two different scores. The Tomatometer is the percentage of approved critics who have given a positive review for the movie. The Audience Score is the percentage of users who have given a score of 3.5 or higher out of 5. As we can see, The Martian is the only movie with both a high Tomatometer and Audience Score. The Hobbit: An Unexpected Journey has a relatively high Audience Score compared to the Tomatometer score, which might be due to a huge fan base:

Figure 2.5: Comparative bar chart

Figure 2.5: Comparative bar chart

Design Practices

  • The axis corresponding to the numerical variable should start at zero. Starting with another value might be misleading, as it makes a small value difference look like a big one.
  • Use horizontal labels—that is, as long as the number of bars is small, and the chart doesn’t look too cluttered.
  • The labels can be rotated to different angles if there isn’t enough space to present them horizontally. You can see this on the labels of the x-axis of the preceding diagram.

Radar Chart

Radar charts (also known as spider or web charts) visualize multiple variables with each variable plotted on its own axis, resulting in a polygon. All axes are arranged radially, starting at the center with equal distances between one another, and have the same scale.

Uses

  • Radar charts are great for comparing multiple quantitative variables for a single group or multiple groups.
  • They are also useful for showing which variables score high or low within a dataset, making them ideal for visualizing performance.

Examples

The following diagram shows a radar chart for a single variable. This chart displays data about a student scoring marks in different subjects:

Figure 2.6: Radar chart for one variable (student)

Figure 2.6: Radar chart for one variable (student)

The following diagram shows a radar chart for two variables/groups. Here, the chart explains the marks that were scored by two students in different subjects:

Figure 2.7: Radar chart for two variables (two students)

Figure 2.7: Radar chart for two variables (two students)

The following diagram shows a radar chart for multiple variables/groups. Each chart displays data about a student’s performance in different subjects:

Figure 2.8: Radar chart with faceting for multiple variables (multiple students)

Figure 2.8: Radar chart with faceting for multiple variables (multiple students)

Design Practices

  • Try to display 10 factors or fewer on a single radar chart to make it easier to read.
  • Use faceting (displaying each variable in a separate plot) for multiple variables/groups, as shown in the preceding diagram, in order to maintain clarity.

In the first section, we learned which plots are suitable for comparing items. Line charts are great for comparing something over time, whereas bar charts are for comparing different items. Last but not least, radar charts are best suited for visualizing multiple variables for multiple groups. In the following activity, you can check whether you understood which plot is best for which scenario.

Activity 2.01: Employee Skill Comparison

You are given scores of four employees (Alex, Alice, Chris, and Jennifer) for five attributes: efficiency, quality, commitment, responsible conduct, and cooperation. Your task is to compare the employees and their skills. This activity will foster your skills in choosing the best visualization when it comes to comparing items.

  1. Which charts are suitable for this task?
  2. You are given the following bar and radar charts. List the advantages and disadvantages of both charts. Which is the better chart for this task in your opinion, and why?

    The following diagram shows a bar chart for the employee skills:

    Figure 2.9: Employee skills comparison with a bar chart

    Figure 2.9: Employee skills comparison with a bar chart

    The following diagram shows a radar chart for the employee skills:

    Figure 2.10: Employee skills comparison with a radar chart

    Figure 2.10: Employee skills comparison with a radar chart

  3. What could be improved in the respective visualizations?

    Note

    The solution for this activity can be found via this link.

Concluding the activity, you hopefully have a good understanding of deciding which comparison plots are best for the situation. In the next section, we will discuss different relation plots.

CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
The Data Visualization Workshop
notes
bookmark Notes and Bookmarks search Search in title playlist Add to playlist download Download options font-size Font size

Change the font size

margin-width Margin width

Change margin width

day-mode Day/Sepia/Night Modes

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY

Submit Your Feedback

Modal Close icon
Modal Close icon
Modal Close icon