Chapter 4. Creating Graphs with ggplot
In the previous chapter, you learned a variety of useful techniques to produce high-quality graphs using qplot
. In this chapter, you will learn how to create graphs using ggplot
, an even more powerful graphics tool than qplot
. In a book of this scope, it is impossible to cover all that ggplot
has to offer. Thus, here we learn only the basic methods of ggplot
. After reading this chapter, you should be able to create interesting graphics using ggplot
. If you wish to read further about ggplot
, links to other literature are given in this chapter. The topics covered in this chapter include the following:
Setting up variables for plotting
Adding color, symbol type, size, and shape as layers
Controlling plotting backgrounds and margins
Creating line graphs, histograms, bar chats, and boxplots
Using attractive color schemes
By the end of this chapter, you should understand the basic principles behind the creation of graphics in ggplot
, and will be able to create...