Plot expression data in a scatter plot
plot_scatter(
data,
smoothing_method = "lm",
group_colors = RColorBrewer::brewer.pal(9, "Set1"),
title_color = "black",
title = NULL,
col_title = NULL,
row_title = NULL,
legend_title = NULL,
legend_position = "bottom",
margins = "both",
marginal_type = NULL,
margins_size = 10,
compute_correlation = TRUE,
compute_correlation_method = "pearson",
keep_aspect_ratio = TRUE,
facet = FALSE,
se = FALSE,
pointdensity = TRUE
)
Input data.
Method for smoothing curve, lm
or loess
.
Colors for different groups.
Color for the title.
Main title for the plot.
Title for the x-axis.
Title for the y-axis.
Title for the legend.
The position of legend.
The position of marginal figure ("both", "x", "y").
The type of marginal figure (density
, histogram
, boxplot
, violin
, densigram
).
The size of marginal figure, note the bigger size the smaller figure.
Whether to compute and print correlation on the figure.
Method to compute correlation (pearson
or spearman
).
Logical value, whether to set aspect ratio to 1:1.
Faceting variable. If setting TRUE, all settings about margins will be inalidation.
Display confidence interval around smooth.
Plot point density when only provide 1 cluster.
ggplot object
data("example_matrix")
test_data <- data.frame(
example_matrix[1:200, c(1, 7)],
c = c(
rep("c1", 40),
rep("c2", 40),
rep("c3", 40),
rep("c4", 40),
rep("c5", 40)
)
)
p1 <- plot_scatter(
test_data
)
p2 <- plot_scatter(
test_data,
marginal_type = "boxplot"
)
p1 + p2
p3 <- plot_scatter(
test_data,
facet = TRUE
)
p3
p4 <- plot_scatter(
test_data[, 1:2],
marginal_type = "histogram"
)
p4