O'Reilly logo

ggplot2 Essentials by Donato Teutonico

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Axis scales

Together with axis labels, you will also often need to change the axis scales. For instance, you may want to change the scale in log values or modify the default range values included in the axis when creating the plot. In this section, we will take a look at exactly how to do these modifications. The axis scales as well as the legends are derived from the scales used in aesthetic mappings, so, in many cases, if you want to manipulate such values, you will need to use the scale function relative to your specific situation. For this reason, we will treat the plots with only discrete scales as different from those with only continuous scales.

The discrete axis

You may have a plot with discrete scales, for instance, when you represent ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required