View source: R/utilities-axis.R
setYAxis | R Documentation |
Set Y-axis properties of a ggplot
object
setYAxis(
plotObject,
scale = NULL,
valuesLimits = NULL,
axisLimits = NULL,
limits = lifecycle::deprecated(),
ticks = NULL,
ticklabels = NULL,
minorTicks = NULL,
font = NULL,
expand = NULL
)
plotObject |
A |
scale |
Scale of axis. Use enum |
valuesLimits |
Optional numeric values of values limits |
axisLimits |
Optional numeric values of axis limits |
limits |
|
ticks |
Optional values or function for axis ticks |
ticklabels |
Optional values or function for axis ticklabels |
minorTicks |
Optional values or function for axis minor ticks |
font |
A |
expand |
Logical defining if data is expanded until axis |
A ggplot
object
myPlot <- addLine(x = c(1, 2, 3), y = c(10, 50, 100))
# Set y-axis in log scale
setYAxis(myPlot, scale = Scaling$log)
# Set y-axis ticklabels to Greek letters
setYAxis(myPlot, ticks = c(10, 50, 100), ticklabels = parse(text = c("alpha", "beta", "gamma")))
# Set y-axis limits
setYAxis(myPlot, axisLimits = c(10, 75))
# Set y-axis fonts
setYAxis(myPlot, font = Font$new(color = "blue", size = 14))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.