# How to easily make ggplot2 type of scatterplot, ezplot - Part 7

## Master R

When you have two continuous variables and want to see their relationship, you’d draw a scatterplot by putting one variable on the x-axis and the other variable on the y-axis. In this post, we’ll look at how to draw scatterplots using the mk_scatterplot() function from the ezplot package. We’ll also use the scale_axis() function, which allows us to easily change the scale of the x-axis or y-axis. Let’s get started.

#### Prerequisites

1. Install a set of development tools
• On Windows, download and install Rtools.
• On Mac, install the Xcode command line tools.
• On Linux, install the R development package, usually called r-devel or r-base-dev.
2. Install devtools by running install.packages("devtools") in R.

#### It might be more informative if we use log10 scale instead.

Note we also changed the transparency and size of the points by passing values to the pt_alpha and pt_size arguments. And we added a regression line by setting add_line=T and gave it a narrower width by setting linew=0.8.

#### Finally, the dataset contains a variable called “made_money”, indicating if a film made money or not. We can use it to separate the points into two groups, where each group has its own regression line.

See how easy it is? All we need is to pass the name of the grouping variable, “made_money”, to the fillby argument.

I created ezplot because there are too many detailed commands to remember when making and customizing a ggplot. If ezplot has improved your productivity, please tell your friends about it. In addition, I’m writing a book called ezplot: How to Easily Make ggplot2 Graphics for Data Analysis, and it is 20% complete. Read the sample chapters for FREE and get notified when the book is published.