Description Usage Arguments Value Author(s) References See Also Examples
Customize x and y axis of a plot generated with ggplot2 package
| 1 2 3 4 5 6 7 8 | ggplot2.setAxis(plot, xShowTitle = TRUE, yShowTitle = TRUE, xtitle = NULL,
  ytitle = NULL, xtitleFont = c(14, "bold", "black"), ytitleFont = c(14,
  "bold", "black"), xlim = NULL, ylim = NULL, xScale = c("none", "log2",
  "log10"), yScale = c("none", "log2", "log10"), xShowTickLabel = TRUE,
  yShowTickLabel = TRUE, xTickLabelFont = c(12, "bold", "black"),
  yTickLabelFont = c(12, "bold", "black"), xtickLabelRotation = 0,
  ytickLabelRotation = 0, hideAxisTicks = FALSE, axisLine = c(0.5,
  "solid", "#E5E5E5"))
 | 
| plot | A plot object generated with ggplot2 or easyGgplot2 packages (boxplot, densityplot, histogram, dotplot, ....) | 
| xShowTitle, yShowTitle | if TRUE, x axis and y axis titles will be shown. Default values are TRUE. | 
| xtitle, ytitle | x and y axis labels. | 
| xtitleFont, ytitleFont | A vector of length 3 indicating respectively the size, the style and the color of x and y axis titles. Default values are c(14,"bold", "black"). | 
| xlim, ylim | Limit for the x and y axis. Default values are NULL. | 
| xScale, yScale | x and y axis scales. Possible values are c("none", "log2", "log10"). Example: yScale="log2". Default values are "none". | 
| xShowTickLabel, yShowTickLabel | if TRUE, x and y axis tick mark labels will be shown. Default values are TRUE. | 
| xTickLabelFont, yTickLabelFont | A vector of length 3 indicating respectively the size, the style and the color of x and y axis tick label fonts. Default values are c(12, "bold", "black"). | 
| xtickLabelRotation, ytickLabelRotation | Rotation angle of x and y axis tick labels. Default values are 0. | 
| hideAxisTicks | if TRUE, x and y axis ticks are removed. Default value is FALSE. | 
| axisLine | A vector of length 3 indicating respectively the size, the line type and the color of axis lines. Default value is c(0.5, "solid", "#E5E5E5"). | 
a ggplot
Alboukadel Kassambara <alboukadel.kassambara@gmail.com>
http://www.sthda.com
| 1 2 3 4 | #Boxplot using easyGgplot2 package
p<-ggplot2.boxplot(data=ToothGrowth, xName='dose',yName='len')
ggplot2.setAxis(p, xtitle="Dose (mg)", ytitle="length", 
                axisLine=c(0.5, "solid", "black"))
 | 
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.