top of page
Writer's pictureAbhijeet Srivastav

Visualization In Python : III :Pie, Stacked Bar, Stacked Area Graphs




Hey good to see you back, I hope you are following the previous blogs if not you should check them out, its not necessary to know those topics for this tutorial but it will surely increase your knowledge.


Well know lets continue from where we left off.


Composition Plots

Composition plots are ideal if you think about something as a part of a whole. For static data, you can use pie charts, stacked bar charts, or Venn diagrams. Pie charts or donut charts help show proportions and percentages for groups. If you need an additional dimension, stacked bar charts are great. Venn diagrams are the best way to visualize overlapping groups, where each group is represented by a circle. For data that changes over time, you can use either stacked bar charts or stacked area charts.


Pie Chart

Pie charts illustrate numerical proportions by dividing a circle into slices. Each arc length represents a proportion of a category. The full circle equates to 100%. For humans, it is easier to compare bars than arc lengths; therefore, it is recommended to use bar charts or stacked bar charts the majority of the time.

Use

To compare items that are part of a whole.

Examples

The following diagram shows household water usage around the world:




Design Practices

  • Arrange the slices according to their size in increasing/decreasing order, either in a clockwise or counterclockwise manner.

  • Make sure that every slice has a different color.

Variants: Donut Chart

An alternative to a pie chart is a donut chart. In contrast to pie charts, it is easier to compare the size of slices, since the reader focuses more on reading the length of the arcs instead of the area. Donut charts are also more space-efficient because the center is cut out, so it can be used to display information or further divide groups into subgroups.

The following diagram shows a basic donut chart:



The following diagram shows a donut chart with subgroups:


Design Practice

  • Use the same color that's used for the category for the subcategories. Use varying brightness levels for the different subcategories.

Stacked Bar Chart

Stacked bar charts are used to show how a category is divided into subcategories and the proportion of the subcategory in comparison to the overall category. You can either compare total amounts across each bar or show a percentage of each group. The latter is also referred to as a 100% stacked bar chart and makes it easier to see relative differences between quantities in each group.

Use

  • To compare variables that can be divided into sub-variables

Examples

The following diagram shows a generic stacked bar chart with five groups:



The following diagram shows a 100% stacked bar chart with the same data that was used in the preceding diagram:


The following diagram illustrates the daily total sales of a restaurant over several days. The daily total sales of non-smokers are stacked on top of the daily total sales of smokers:


Design Practices

  • Use contrasting colors for stacked bars.

  • Ensure that the bars are adequately spaced to eliminate visual clutter. The ideal space guideline between each bar is half the width of a bar.

  • Categorize data alphabetically, sequentially, or by value, to uniformly order it and make things easier for your audience.

Stacked Area Chart

Stacked area charts show trends for part-of-a-whole relations. The values of several groups are illustrated by stacking individual area charts on top of one another. It helps to analyze both individual and overall trend information.

Use

To show trends for time series that are part of a whole.

Examples

The following diagram shows a stacked area chart with the net profits of Google, Facebook, Twitter, and Snapchat over a decade:


Design Practice

  • Use transparent colors to improve information visibility. This will help you to analyze the overlapping data and you will also be able to see the grid lines.

In this blog, we covered various composition plots and we will continue the rest topics in next blog, so stay tuned.



 
63 views0 comments

Comments

Couldn’t Load Comments
It looks like there was a technical problem. Try reconnecting or refreshing the page.
bottom of page