save_Plot | R Documentation |
Save a plot as png, pdf and svg.
save_Plot(
plot,
figure_path = NULL,
create_path = TRUE,
file_name = NULL,
dpi = 300,
output_format = "publication",
width = 8,
height = 8
)
plot |
Plot to save. |
figure_path |
|
create_path |
|
file_name |
|
dpi |
|
output_format |
|
width , height |
|
Nothing.
## Not run:
# Check Suggests.
value <- SCpubr:::check_suggests(function_name = "save_Plot", passive = TRUE)
if (isTRUE(value)){
# Define your Seurat object.
sample <- readRDS(system.file("extdata/seurat_dataset_example.rds", package = "SCpubr"))
# Generate a plot.
p <- SCpubr::do_DimPlot(sample = sample)
# Default parameters.
SCpubr::save_Plot(plot = p)
# Specifying the name and folder.
SCpubr::save_Plot(plot = p,
figure_path = "/path/to/my/figures/",
file_name = "my_figure")
# Specify to also create a new folder.
SCpubr::save_Plot(plot = p,
figure_path = "/path/to/my/figures/",
file_name = "my_figure",
create_path = TRUE)
# Set dimensions for the figure.
SCpubr::save_Plot(plot = p,
figure_path = "/path/to/my/figures/",
file_name = "my_figure",
create_path = TRUE,
width = 8,
height = 8)
# Set quality (dpi).
SCpubr::save_Plot(plot = p,
figure_path = "/path/to/my/figures/",
file_name = "my_figure",
create_path = TRUE,
width = 8,
height = 8,
dpi = 300)
} else if (base::isFALSE(value)){
message("This function can not be used without its suggested packages.")
message("Check out which ones are needed using `SCpubr::state_dependencies()`.")
}
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.