ggplot2 in R
How to Create a Residual Plot in ggplot2 (With Example)
Residual plots are used to assess whether or not the residuals in a regression model are normally distributed and whether or not they exhibit...
ggplot2 in R
How to Create a Q-Q Plot in ggplot2 (With Example)
A Q-Q plot, short for “quantile-quantile” plot, is used to assess whether or not a set of data potentially came from some theoretical distribution.
In...
ggplot2 in R
How to Add Subtitle in ggplot2 (3 Examples)
You can use the following methods to add a subtitle to plots in ggplot2:
Method 1: Add Subtitle
p +
labs(title='My Title', subtitle='My Subtitle')
Method 2:...
ggplot2 in R
How to Reverse Order of Axis in ggplot2 (With Examples)
You can use the scale_y_reverse() and scale_x_reverse() functions to quickly reverse the order of an axis in ggplot2.
These functions use the following basic syntax:
ggplot(df,...
ggplot2 in R
How to Use scale_x_continuous in ggplot2 (With Examples)
You can use the scale_x_continuous() function in ggplot2 to customize the x-axis of a given plot.
This function uses the following basic syntax:
p +
...
ggplot2 in R
How to Use scale_y_continuous in ggplot2 (With Examples)
You can use the scale_y_continuous() function in ggplot2 to customize the y-axis of a given plot.
This function uses the following basic syntax:
p +
...
ggplot2 in R
How to Change Facet Axis Labels in ggplot2
You can use the as_labeller() function to change facet axis labels in ggplot2:
ggplot(df, aes(x, y)) +
geom_point() +
facet_wrap(.~group,
...
Subscribe
- Never miss a story with notifications
- Gain full access to our premium content
- Browse free from up to 5 devices at once
Must read