View source: R/plot_pheatmap.R
| plot.pheatmap | R Documentation |
This S3 method allows pheatmap objects (returned by Celltype_Calculate())
to be plotted using the generic plot() function. Without this method,
attempting to use plot() on a pheatmap object results in an error.
## S3 method for class 'pheatmap'
plot(x, ...)
x |
A pheatmap object, typically from |
... |
Additional arguments (currently ignored) |
Pheatmap objects contain a gtable component that needs to be drawn using
grid graphics. This method handles that automatically when plot() is called.
Alternative ways to display pheatmaps:
print(pheatmap_object) - Works natively
plot(pheatmap_object) - Works after loading SlimR
grid::grid.draw(pheatmap_object$gtable) - Direct access
Invisibly returns the input pheatmap object after displaying it
## Not run:
# After running Celltype_Calculate()
cluster_results <- Celltype_Calculate(
seurat_obj = sce,
gene_list = Markers_list,
species = "Human"
)
# Now both of these work:
print(cluster_results$Heatmap_plot)
plot(cluster_results$Heatmap_plot)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.