View source: R/fast.multi.plot.R
fast.multi.plot | R Documentation |
Method to create multiple plots for each marker. This function allows you to create a grid of plots, where the cells are plotted by a series of columns, and/or subsetted by a certain factor (e.g. one sample per plot). Makes use of Spectre functions fast.colour.plot and make.density.plot.
fast.multi.plot(dat, x.axis, y.axis, plot.by, divide.by, add.density, col.type, figure.title, align.xy.by, align.col.by, colours, dot.size, col.min.threshold, col.max.threshold, path, plot.width, plot.height, blank.axis, save.each.plot)
dat |
NO DEFAULT. A data frame containing all the data you wish to plot |
x.axis |
NO DEFAULT. X axis |
y.axis |
NO DEFAULT. Y axis |
plot.by |
NO DEFAULT. A vector of character names for the columns you wish to plot. |
divide.by |
DEFAULT = NULL. Here you can specify a character name of a column you wish to use to divide up the dataset. |
add.density |
DEFAULT = FALSE. Can specify to add a density plot at the end the series of colour plots |
hex |
DEFAULT = FALSE. Whether to split the data into bins and show the average expression of the bin. Currently does not work with density plots, only for those features in the plot.by. |
hex.bins |
DEFAULT = 30. Number of bins to split into. Only used if hex is TRUE. |
col.type |
DEFAULT = "continuous". Can also be "factor". |
figure.title |
DEFAULT = "Multi plot". Also used as the prefix for the saved file name. |
global.xy |
DEFAULT = TRUE. Defines the limits for the X and Y based on the whole dataset. If FALSE, then each plot X & Y limits scale individually. |
global.col |
DEFAULT = TRUE. Defines the limits for the colour axis based on the whole dataset. If FALSE, then each plot colour limit scales individually. |
colours |
DEFAULTS to 'spectral'. What colour scheme do you want to use. Only used if type = 'colour', ignored if type = 'factor'. Can be 'jet', 'spectral', 'viridis', 'inferno', 'magma', or "BuPu". |
dot.size |
DEFAULT = 1. Numeric. Size of the dots. |
col.min.threshold |
DEFAULT = 0.01. Numeric. Define minimum threshold for colour scale. Values below this limit will be coloured as the chosen minimum threshold. |
col.max.threshold |
DEFAULT = 0.995 Numeric. Define maximum threshold for colour scale. Values above this limit will be coloured as the chosen maximum threshold. |
path |
DEFAULT = getwd() – i.e. the current working directory. Path to the desired output directory |
plot.width |
DEFAULT = 9. |
plot.height |
DEFAULT = 7. |
blank.axis |
DEFAULT = FALSE. Logical. Do you want a minimalist graph? |
save.each.plot |
DEFAULT = FALSE. Logical. Do you want to save each plot? |
Thomas Ashhurst, thomas.ashhurst@sydney.edu.au Felix Marsh-Wakefield, felix.marsh-wakefield@sydney.edu.au
# Create grid of plots on demonstration data
Spectre::fast.multi.plot(dat = as.data.table(Spectre::demo.umap),
x.axis = "UMAP_42_X",
y.axis = "UMAP_42_Y",
plot.by = c("BV605.Ly6C", "BUV737.B220", "AF700.CD45"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.