From the course: Data Visualization in R with ggplot2

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Changing scales

Changing scales

From the course: Data Visualization in R with ggplot2

Start my 1-month free trial

Changing scales

- [Instructor] The X axis and Y axis are two examples of a more general concept known as a scale. Scales describe how data is mapped from the data set onto the visualization. In the example of this bar graph, the X axis shows categorical data; the region. Each observation in the data set has a region value of Midwest, Northeast, South or West and it is assigned an X value that corresponds to that region. The Y axis on the other hand shows the total number of schools in each region. It is continuous value and each region's bar rises to the level of the total number of schools in that region. There is one additional scale on this plot; the fill color of each bar is also a scale. It maps private schools using a salmon color and public schools using a blue color. You can also have scales corresponding to other attributes of a plot; such as shape, line color, and transparency. We can make many different changes to the scales on a plot to customize it to our own needs. We do this by using a…

Contents