ggtexttable()
(#125, #129 and #283):
tab_cell_crossout()
: cross out a table cell.tab_ncol(), tab_nrow()
: returns, respectively, the number of columns and rows in a ggtexttable.tab_add_hline()
: Creates horizontal lines or separators at the top or the bottom side of a given specified row.tab_add_vline()
: Creates vertical lines or separators at the right or the left side of a given specified column.tab_add_border(), tbody_add_border(), thead_add_border()
: Add borders to table; tbody is for table body and thead is for table head.tab_add_title()
and tab_add_footnote()
to add titles and footnotes (#243).create_aes()
added to create aes mapping from a list. Makes programming easy with ggplot2 (#229).coord.flip
added to support adding p-values onto horizontal ggplots (#179). When adding the p-values to a horizontal ggplot (generated using coord_flip()
), you need to specify the option coord.flip = TRUE
.median_hilow_()
and median_q1q3()
- added ([@davidlorenz, #209](https://github.com/kassambara/ggpubr/issues/209)):
median_hilow_()
: computes the sample median and a selected pair of outer quantiles having equal tail areas. This function is a reformatted version of Hmisc::smedian.hilow()
. The confidence limits are computed as follow: lower.limits = (1-ci)/2
percentiles; upper.limits = (1+ci)/2
percentiles. By default (ci = 0.95
), the 2.5th and the 97.5th percentiles are used as the lower and the upper confidence limits, respectively. If you want to use the 25th and the 75th percentiles as the confidence limits, then specify ci = 0.5
or use the function median_q1q3()
.median_q1q3()
: computes the sample median and, the 25th and 75th percentiles. Wrapper around the function median_hilow_() using ci = 0.5.get_breaks()
added to easily create breaks for numeric axes. Can be used to increase the number of x and y ticks by specifying the option n
. It’s also possible to control axis breaks by specifying a step between ticks. For example, if by = 5, a tick mark is shown on every 5 ([@Chitanda-Satou, #258](https://github.com/kassambara/ggpubr/issues/258)).ggscatterhist()
([@juliechevalier, #176](https://github.com/kassambara/ggpubr/issues/176)):
ggscatterhist()
is now a list of ggplots, containing the main scatter plot (sp
) and the marginal plots (xplot
and yplot
), which can be customized by the end user using the standard ggplot verbsalternative
supported in stat_cor()
(#276).position
in ggline()
to make position “dodged” (#52).outlier.shape
in ggboxplot(). Default is 19. To hide outlier, specify outlier.shape = NA. When jitter is added, then outliers will be automatically hidden.ggdotchart()
using the option sorting = "none"
(#115, #223).weight
added in gghistogram()
for creating a weighted histogram (#215)ggscaterhist()
takes into account the argument position
in margin.params
when marginal plot is a histogram (#286).ggbarplot()
enhanced to better handle the creation of dodged bar plots combined with jitter points ([@aherholt, #176](https://github.com/kassambara/ggpubr/issues/282))bracket.shorten
added in stat_pvalue_manual()
and geom_bracket()
. a small numeric value in [0-1] for shortening the with of bracket (#285).bracket.nudge.y
added in stat_pvalue_manual()
and geom_bracket()
. Vertical adjustment to nudge brackets by. Useful to move up or move down the bracket. If positive value, brackets will be moved up; if negative value, brackets are moved down (#281).numeric.x.axis
added in ggerrorplot()
; logical value, If TRUE, x axis will be treated as numeric. Default is FALSE (#280).width
is now considered in ggadd()
for plotting error bars (#278).linetype
in ggpaired()
.geom_exec()
used in ggpaired()
to add lines between paired points.ggmaplot()
now supports two input formats (#198):
ggmaplot()
:
alpha
for controlling point transparency/density ([@apcamargo, #152](https://github.com/kassambara/ggpubr/issues/152)).label.select
to select specific genes to show on the plot ([@apastore, #70](https://github.com/kassambara/ggpubr/issues/70))ggadd()
the fill
argument is considered for jitter points only when the point shape is in 21:25 ([@atakanekiz, #148](https://github.com/kassambara/ggpubr/issues/148)).parse
added in ggscatter()
and in ggtext()
. If TRUE, the labels will be parsed into expressions and displayed as described in ?plotmath (#250).stroke
supported in ggscatter()
and in ggline()
. Used only for shapes 21-24 to control the thickness of points border ([@bioguy2018, #258](https://github.com/kassambara/ggpubr/issues/236)).stat_cor()
function code has been simplified. New arguments p.accuracy
and r.accuracy
added; a real value specifying the number of decimal places of precision for the p-value and the correlation coefficient, respectively. Default is NULL. Use (e.g.) 0.01 to show 2 decimal places of precision ([@garthtarr, #186](https://github.com/kassambara/ggpubr/issues/186), [@raedevan6, #114](https://github.com/kassambara/ggpubr/issues/114), #270).annotate_figure()
manual updated to show how to use of superscript/subscript in the axis labels (#165).ggtextable()
now supports further customization when theme is specified (#283).font.family
is now correctly handled by ggscatter()
(#149)ggpar()
arguments are correctly applied using ggpie()
(#277).ggscatter()
: When conf.int = FALSE
, fill color is set to “lightgray” for the regression line confidence band ([@zhan6073, #111](https://github.com/kassambara/ggpubr/issues/111)).gghistogram()
supports the paramter yticks.by
([@Chitanda-Satou, #258](https://github.com/kassambara/ggpubr/issues/258)).ggsummarystats()
to create a GGPLOT with summary stats table under the plot ( #251).clean_table_theme()
to clean the the theme of a table, such as those created by ggsummarytable()
ggbarplot()
now supports stacked barplots with error bars (#245).vjsut
in stat_compare_means()
to move the text up or down relative to the bracket.type
in geom_bracket()
to specify label type. Can be “text” or “expression” (for parsing plotmath expression); #253.labeller
to the function facet()
position
in get_legend()
to specify legend positionlegend.grob
in ggarrange()
to specify a common legend you want to add onto the combined plot.cor.coef.name
in the function stat_cor()
. Can be one of “R” (pearson coef), “rho” (spearman coef) and “tau” (kendall coef). Uppercase and lowercase are allowed ([@andhamel, #216](https://github.com/kassambara/ggpubr/issues/228)).digits, r.digits, p.digits
in the function stat_cor()
. Integer indicating the number of decimal places (round) or significant digits (signif) to be used for the correlation coefficient and the p-value ([@raedevan6, #216](https://github.com/kassambara/ggpubr/issues/114)).compare_means()
adapted to tidyr v>= 1.0.0 by specifying cols in the unnest() function ([@Youguang, #216](https://github.com/kassambara/ggpubr/issues/216)).stat_pvalue_manual()
can now handle an rstatix test result containing only one group column.stat_central_tendency()
to add central tendency measures (mean, median, mode) to density and histogram plotsstat_overlay_normal_density()
to overlay normal density plot (with the same mean and SD) to the density distribution of ‘x’.exact = FALSE
is no longer used when computing correlation in stat_cor()
([@tiagochst, #205](https://github.com/kassambara/ggpubr/issues/205))ggpie()
keeps now the default order of labels ([@WortJohn, #203](https://github.com/kassambara/ggpubr/pull/203))geom_bracket()
for adding brackets with label annotation to a ggplot. Helpers for adding p-value or significance levels to a plot.compare_means()
has been adapted to tidyr v1.0.0 ([@jennybc, #196](https://github.com/kassambara/ggpubr/pull/196))geom_exec()
now handles geom_bracket()
argumentsvjust
, hide.ns
, step.increase
, step.group.by
, color
and linetype
added in stat_pvalue_manual()
stat_pvalue_manual()
can now guess automatically the significance label column.show.legend
added to ggadd()
and add_summary()
functions.gghistogram()
. Works now when the x variable is R keyword, such as var, mean, etc. (#192)ggline()
, error bars now react automatically to grouping by line type (#191)step.increase
added in stat_compare_means()
to avoid overlap between brackets.stat_pvalue_manual()
x axis variable is no longer automatically converted into factor. If your x variable is a factor, make sure that it is converted into factor.stat_pvalue_manual()
can automatically handle the output of rstatix testsggbarplot()
and ggviolin()
now automatically create error bars by groups when users forget the option add.params = list(group = )
(#183).ggarrange()
works when either ncol = 1
or nrow = 1
([@GegznaV, #141](https://github.com/kassambara/ggpubr/issues/144).compare_means()
set automatically the option exact = FALSE
. This is no longer the case ([@stemicha, #141](https://github.com/kassambara/ggpubr/issues/141).stat_pvalue_manual()
now supports dodged grouped plots ([@emcnerny, #104](https://github.com/kassambara/ggpubr/issues/104)).position
is now handled by ggdotplot()
([@Adam-JJJJJ, #178](https://github.com/kassambara/ggpubr/issues/178))label.sep
argument works now in ggscatter()
and stat_cor()
([@sbbmu, #150](https://github.com/kassambara/ggpubr/issues/150))ggscatter()
to avoid freezing when the add
argument is incorrect ([@atakanekiz, #135](https://github.com/kassambara/ggpubr/issues/180)).The option ref.group
was only considered when the grouping variable contains more than two levels. In that case, each level is compared against the specified reference group. Now, ref.group
option is also considereded in two samples mean comparisons ([@OwenDonohoe, #118](https://github.com/kassambara/ggpubr/issues/118))
Now, ggqqplot()
reacts to the argument conf.int.level
([@vsluydts, #123](https://github.com/kassambara/ggpubr/issues/123)
Added error bar color is now inherited from the main plot ([@JesseRop, #109](https://github.com/kassambara/ggpubr/issues/109)
bxp.errorbar
added to ggboxplot()
for adding error bars at the top of the box plots ([@j3ypi, #105](https://github.com/kassambara/ggpubr/issues/105).stat_pvalue_manual()
for adding p-values generated elswhere ([@achamess, #81](https://github.com/kassambara/ggpubr/issues/81), [@grst, #65](https://github.com/kassambara/ggpubr/issues/65)).alpha
option added to ggviolin()
[@mtmatter, #77](https://github.com/kassambara/ggpubr/pull/77)bracket.size
added to stat_compare_means()
[@mtmatter, #43](https://github.com/kassambara/ggpubr/issues/43)stat_cor()
supports R^2 as an option [@philament, #32](https://github.com/kassambara/ggpubr/issues/32)position
added in gghistogram()
. Allowed values include “identity”, “stack”, “dodge”.ci
added in ggerrorplot()
[@abrar-alshaer, #94](https://github.com/kassambara/ggpubr/issues/94)ggscatter()
can remove the letter ‘a’ from the legend, when the argument show.legend.text = FALSE
specified [@atsyplenkov, #106](https://github.com/kassambara/ggpubr/issues/106).size
option to ggscatter add.params
is supported [@retrogenomics, #94](https://github.com/kassambara/ggpubr/issues/53).ggdonutchart()
added.Significance levels can be now customized and passed to stat_compare_means()
([@jaison75, #45](https://github.com/kassambara/ggpubr/issues/30)).
Editing pdf size is now supported in ggexport()
([@JauntyJJS, #45](https://github.com/kassambara/ggpubr/issues/63)).
ggscatterhist()
the x variable was plotted two times, on both the plot x & y margins, instead of having, as expected, a) the x variable on the main plot x margin and 2) the y variable on the main plot y margin. This has been now fixed.ggdotchart()
sorted automatically within groups when the color
argument is specified, even when groups = NULL. This default behaviour has been now removed. Sorting withi groups is performed only when the argument group
is specified ([@sfeds, #90](https://github.com/kassambara/ggpubr/issues/90)).yticks.by
and xticks.by
work with NAs ([@j3ypi, #89](https://github.com/kassambara/ggpubr/issues/89)).New function ggballoonplot()
added to visualize a contingency table.
ggdotchart()
can be now used to plot multiple groups with position = position_dodge()
([@ManuelSpinola, #45](https://github.com/kassambara/ggpubr/issues/45)).
New function ggscatterhist()
to create a scatter plot with marginal histograms, density plots and box plots.
New theme theme_pubclean()
: a clean theme without axis lines, to direct more attention to the data.
New arguments in ggarrange()
to customize plot labels ([@G-Thomson, #41](https://github.com/kassambara/ggpubr/issues/38)):
New argument method.args
added to stat_compare_means()
. A list of additional arguments used for the test method. For example one might use method.args = list(alternative = “greater”) for wilcoxon test ([@Nicktz, #41](https://github.com/kassambara/ggpubr/issues/41)).
New argument symnum.args
added to stat_compare_means()
. A list of arguments to pass to the function symnum for symbolic number coding of p-values. For example, symnum.args <- list(cutpoints = c(0, 0.0001, 0.001, 0.01, 0.05, 1), symbols = c("****", "***", "**", "*", "ns"))
New functions table_cell_font()
and table_cell_bg()
to easily access and change the text font and the background of ggtexttable()
cells ([@ProbleMaker, #29](https://github.com/kassambara/ggpubr/issues/29)).
New argument numeric.x.axis
in ggline()
. logical. If TRUE, x axis will be treated as numeric. Default is FALSE. ([@mdphan, #35](https://github.com/kassambara/ggpubr/issues/35))
New argument lab.nb.digits
in ggbarplot()
. Integer indicating the number of decimal places (round) to be used (#28). Example: lab.nb.digits = 2.
New argument tip.length
in stat_compare_means()
. Numeric vector with the fraction of total height that the bar goes down to indicate the precise column. Default is 0.03. Can be of same length as the number of comparisons to adjust specifically the tip lenth of each comparison. For example tip.length = c(0.01, 0.03).
get_legend()
returns NULL when the plot doesn’t have legend.Now data argument are supported in stat_compare_means()
when the option comparisons are specified ([@emcnerny, #48](https://github.com/kassambara/ggpubr/issues/48))
Now compare_means()
returns the same p-values as stat_compare_means()
([@wydty, #15](https://github.com/kassambara/ggpubr/issues/34)).
stat_compare_means()
now reacts to label = “p.format” when comparisons specified (#28).
Now, the p.values are displayed correctly when ref.group is not the first group ([@sehufnkjesktgna, #15](https://github.com/kassambara/ggpubr/issues/27)).
In ggpar()
, now legend.title
can be either a character vector, e.g.: legend.title = “Species” or a list, legend.title = list(color = "Species", linetype = "Species", shape = "Species")
.
New argument ellipse.border.remove
in ggscatter()
to remove ellipse border lines.
ggscatter(mtcars, x = "mpg", y = "wt",
color = "cyl",
ellipse = TRUE, mean.point = TRUE,
ellipse.border.remove = TRUE)
In ggscatter
(), the argument mean.point
now reacts to fill color.
Support for text justification added in ggtexttable()
([@cj-wilson, #15](https://github.com/kassambara/ggpubr/issues/18))
The function ggpie()
can now display japanese texts. New argument font.family
in ggpie
() and in ggpar()
([@tomochan001, #15](https://github.com/kassambara/ggpubr/issues/15)).
Using time on x axis works know with ggline()
and ggbarplot()
([@jcpsantiago, #15](https://github.com/kassambara/ggpubr/issues/17)).
stat_compare_means()
now reacts to hide.ns
properly.drawDetails.splitText()
exported so that the function ggparagraph()
works properly.ggbarplot()
, now labels correspond to the true size of bars ([@tdelhomme, #15](https://github.com/kassambara/ggpubr/issues/15)).stat_compare_means()
now keep the default order of factor levels ([@RoKant, #12](https://github.com/kassambara/ggpubr/issues/12)).gradient_color()
and gradient_color()
: change gradient color and fill palettes.clean_theme()
: remove axis lines, ticks, texts and titles.get_legend()
: to extract the legend labels from a ggplot object.as_ggplot()
: Transform the output of gridExtra::arrangeGrob()
and gridExtra::grid.arrange()
to a an object of class ggplot.ggtexttable()
: to draw a textual table.ggparagraph()
: to draw a paragraph of text.annotate_figure()
to annotate (arranged) ggplots.text_grob()
to create easily a customized text graphical object.background_image()
to add a background image to a ggplot.theme_transparent()
to create a ggplot with transparent background.gghistogram()
, density curve and rug react to the fill color.ggarrange()
:
àlign
to specify whether graphs in the grid should be horizontally (“h”) or vertically (“v”) aligned.legend
to remove or specify the legend position when arranging multiple plots.common.legend
to create a common unique legend for multiple plots.New functions:
ggarrange()
to arrange multiple ggplots on the same page.ggexport()
to export one or multiple ggplots to a file (pdf, eps, png, jpeg).ggpaired()
to plot paired data.compare_means()
to compare the means of two or multiple groups. Returns a data frame.stat_compare_means()
to add p-values and significance levels to plots.stat_cor()
to add correlation coefficients with p-values to a scatter plot.stat_stars()
to add stars to a scatter plot.Now, the argument y
can be a character vector of multiple variables to plot at once. This might be useful in genomic fields to plot the gene expression levels of multiple genes at once. see ggboxplot()
, ggdotplot()
, ggstripchart()
, ggviolin()
, ggbarplot()
and ggline
.
The argument x
can be a vector of multiple variables in gghistogram()
, ggdensity()
, ggecdf()
and ggqqplot()
.
New functions to edit ggplot graphical parameters:
font()
to change the appearance of titles and labels.rotate_x_text()
and rotate_y_text()
to rotate x and y axis texts.rotate()
to rotate a ggplot for creating horizontal plot.set_palette()
or change_palette()
to change a ggplot color palette.border()
to add/change border lines around a ggplot.bgcolor()
to change ggplot panel background color.rremove()
to remove a specific component from a ggplot.grids()
to add grid lines.xscale()
and yscale()
to change axis scale.New helper functions:
facet()
added to create multi-panel plots (#5).add_summary()
to add summary statistics.ggadd()
to add summary statistics or a geometry onto a ggplot.New data set added: gene_citation
New arguments in ggpar()
: x.text.angle
and y.text.angle
New arguments in ggpubr functions, see ggboxplot()
, ggdotplot()
, ggstripchart()
, ggviolin()
, ggbarplot()
and ggline
:
combine
added to combine multiple y variables on the same graph.merge
to merge multiple y variables in the same ploting area.select
to select which item to display.remove
to remove a specific item from a plot.order
to order plot items.label, font.label, label.select, repel, label.rectangle
to add and customize labelsfacet.by, panel.labs and short.panel.labs
: support for faceting and customization of plot panelsNew argument grouping.vars
in ggtext()
. Grouping variables to sort the data by, when the user wants to display the top n up/down labels.
New arguments in theme_pubr()
:
palette
Can be also a numeric vector of length(groups); in this case a basic color palette is created using the function grDevices::palette()
.Now, ggpar()
reacts to palette when length(palette) = 1 and palette is a color name #3.
ggmaplot()
now handles situations, where there is only upregulated, or downlegulated gnes.
get_palette()
to generate a palette of k colors from ggsci palettes, RColorbrewer palettes and custom color palettes. Useful to extend RColorBrewer and ggsci to support more colors.ggpar()
function can handle a list of ggplots.right
.show.legend.text
in the ggscatter()
function. Use show.legend.text = FALSE to hide text in the legend.title, submain, subtitle, caption, font.submain, font.subtitle, font.caption
in the ggpar()
function.font.family
in ggscatter()
.ggdensity
(gghistogram
) are now shown if data have NA values [@chunkaowang, #1](https://github.com/kassambara/ggpubr/issues/1)ggtext()
for textual annotation.ggscatter()
. A logical value. If TRUE, a star plot is generated.geom_exec()
. A helper function used by ggpubr functions to execute any geom_xx functions in ggplot2. Useful only when you want to call a geom_xx function without carrying about the arguments to put in ggplot2::aes()
.ggbarplot()
.
theme_classic2()
added. Classic theme with axis lines.ggboxplot()
, ggviolin()
, ggdotplot()
, ggstripchart()
, gghistogram()
, ggdensity()
, ggecdf()
and ggqqplot()
can now handle one single numeric vector.# Example
ggboxplot(iris$Sepal.Length)
gghistogram()
, when add_density = TRUE, y scale remains = “..count..”.