View source: R/plot_logscales.R
plot_logscale | R Documentation |
This function allows "log10" or "log2" transformation of X or Y axes. With "log10" transformation, log10 ticks are also added on the outside.
plot_logscale(
Plot,
LogYTrans = "log10",
LogXTrans,
LogYBreaks = waiver(),
LogXBreaks = waiver(),
LogYLimits = NULL,
LogXLimits = NULL,
LogYLabels = waiver(),
LogXLabels = waiver(),
fontsize = 22,
...
)
Plot |
a ggplot2 object. |
LogYTrans |
transform Y axis into "log10" (default) or "log2" |
LogXTrans |
transform X axis into "log10" or "log2" |
LogYBreaks |
argument for |
LogXBreaks |
argument for |
LogYLimits |
a vector of length two specifying the range (minimum and maximum) of the Y axis. |
LogXLimits |
a vector of length two specifying the range (minimum and maximum) of the X axis. |
LogYLabels |
argument for |
LogXLabels |
argument for |
fontsize |
this parameter sets the linewidth of the |
... |
any other arguments to pass to |
Arguments allow for axes limits, breaks and labels to passed on.
This function returns a ggplot2
object of class "gg" and "ggplot".
#save a ggplot object
P <- ggplot(data_t_pratio,
aes(Genotype,Cytokine))+
geom_jitter(shape = 21,
size = 5, width = .2,
aes(fill = Genotype),
alpha = .7)
#transform Y axis
plot_logscale(Plot = P)
#or in one go
plot_logscale(ggplot(data_t_pratio,
aes(Genotype,Cytokine))+
geom_jitter(shape = 21,
size = 5, width = .2,
aes(fill = Genotype),
alpha = .7))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.