ggplot2.setAxis: Customize x and y axis of a plot generated with ggplot2...

Description Usage Arguments Value Author(s) References See Also Examples

Description

Customize x and y axis of a plot generated with ggplot2 package

Usage

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"))

Arguments

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").

Value

a ggplot

Author(s)

Alboukadel Kassambara <alboukadel.kassambara@gmail.com>

References

http://www.sthda.com

See Also

ggplot2.customize

Examples

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"))

YTLogos/easyGgplot2 documentation built on May 3, 2019, 9:03 p.m.