Reader small image

You're reading from  Applied Data Visualization with R and ggplot2

Product typeBook
Published inSep 2018
Reading LevelIntermediate
Publisher
ISBN-139781789612158
Edition1st Edition
Languages
Tools
Right arrow
Author (1)
Dr. Tania Moulik
Dr. Tania Moulik
author image
Dr. Tania Moulik

Tania Moulik has a PhD in particle physics. She has worked at CERN, the European Organization for Nuclear Research, and on the Tevatron at Fermi National Accelerator Laboratory in IL, USA. She has years of programming experience in C++, Python, and R. She has also worked in the feld of big data and has worked with technologies such as grid computing. She has a passion for data analysis and would like to share her passion with others who would like to delve into the world of data analytics. She especially likes R and ggplot2 as a powerful analytics package.
Read more about Dr. Tania Moulik

Right arrow

Advanced Plotting Techniques


Two of the most common advanced plotting techniques are scatter plots and bubble charts. Scatter plots show the relationship between two variables. A bubble chart can include a third variable. Each point (with its values (v1, v2, v3) of associated data) is plotted as a disk, where two of the values show the x and y locations, and the third depicts the size. Just like in a scatter plot, a bubble chart uses numerical variables for its x and y axes. You cannot use categorical variables in a bubble chart.

In this plot, we will plot the electricity consumption per capita for different years and different countries. The size of the point will vary, according to the population of the country.

Creating a Bubble Chart

In this section, we'll create a bubble chart showing the relationship between electricity consumption in different years for different countries. Let's begin by implementing the following steps:

  1. Make a subset of the dataset.
  2. Use geom_point to make a scatter plot...
lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Applied Data Visualization with R and ggplot2
Published in: Sep 2018Publisher: ISBN-13: 9781789612158

Author (1)

author image
Dr. Tania Moulik

Tania Moulik has a PhD in particle physics. She has worked at CERN, the European Organization for Nuclear Research, and on the Tevatron at Fermi National Accelerator Laboratory in IL, USA. She has years of programming experience in C++, Python, and R. She has also worked in the feld of big data and has worked with technologies such as grid computing. She has a passion for data analysis and would like to share her passion with others who would like to delve into the world of data analytics. She especially likes R and ggplot2 as a powerful analytics package.
Read more about Dr. Tania Moulik