Choosing plotting point symbol styles and sizes

In this recipe, we will see how we can adjust the styling of plotting symbols, which is useful and necessary when we plot more than one set of points that represent different groups of data on the same graph.

Getting ready

All you need to try out in this recipe is to run R and type the recipe in the command prompt. You can also choose to save the recipe as a script so that you can use it again later on. We will also use the cityrain.csv example data file that we used in the first chapter. Please read the file into R as follows:

rain<-read.csv("cityrain.csv")

How to do it...

The plotting symbol and size can be set using the pch and cex arguments:

plot(rnorm(100),pch=19,cex=2)

How it works...

The pch argument ...

Get R: Data Analysis and Visualization now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.