View source: R/plt_scale_y_mirror.R
plt_scale_y_mirror | R Documentation |
Mirror the ticks and text from the y axis on the right side.
plt_scale_y_mirror(breaks, labels = NULL, expand = c(0.01, 0), ...)
breaks |
A numeric vector, that will be the breaks in the y axis |
labels |
A vector (default = NULL), that will be the labels in the axis, if not provided 'breaks' will be used instead |
expand |
A numeric vector (default = c(0.01,0)), that is the range expansion used to add some space between the data and the plot border |
A ggplot2 object.
library(ggplot2)
plot <-
ggplot(mtcars,aes(hp,drat))+
geom_point()
plot
plot + plt_scale_y_mirror(breaks = seq(0,40,4))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.