plot_profile_barplot: Plot profile bar graph

plot_profile_barplotR Documentation

Plot profile bar graph

Description

Plot profile bar graph

Usage

plot_profile_barplot(
  df2,
  pos = "stack",
  var_colors = NA,
  out_dir = ".",
  legend_title = "Group",
  labels = "",
  gradient_palette = "RdBu",
  line_size = 1,
  font_size = 10,
  save.to.file = F
)

Arguments

df2

A long format data frame with 4 columns: 1) group (group of bars on x), 2) ID (individual bars on x), 3) variable (components within each bar), 4) value.

pos

How bars should be stacked. Either "fill" (relative ratio, 100% bar) or "stack". See position parameter in geom_bar

var_colors

A vector of colors to manually specify variable colors.

out_dir

The output directory where the plot will be saved, default is current working directory.

labels

A character vector of at least length 1 that will be collapsed for file name/plot titles.

gradient_palette

RColorBrewer palette for variable colors if var_colors is NA. See RColorBrewer::display.brewer.all() for all options.

line_size

The thickness of axis lines.

font_size

The size of axis title on plots. The size of plot subtitle and caption is font_size / 2. The size of legend text and x axis text is font_size / 3 and font_size / 1.5.

save.to.file

If TRUE, save plot to file in out_dir. If FALSE, print to panel.

Value

Plot object if save.to.file is FALSE.

Example of input data frame

group ID variable value 1 low 1_21043 CD3 273.2400 2 low 1_36312 CD3 700.2100 3 low 1_37265 CD3 931.1133 4 low 1_39924 CD3 1503.2325

See Also

Other plotting: plot_corrplot(), plot_corrplotgg(), plot_discrete_barplot(), plot_heatmap(), plot_het_barplot(), plot_indiv_boxplot(), plot_indiv_corrscatt(), plot_indiv_paired(), plot_overview_boxplot(), plot_overview_corr_scatt(), run_corrplot_analysis()


kazeera/hourglass documentation built on April 5, 2025, 7:18 a.m.