vignettes/visualization_options.Rmd
visualization_options.Rmd
Giotto provides different ways to visualize your spatial data:
Most functions both have a 2D and 3D version, like spatDimPlot2D and spatDimPlot3D. In those cases the spatDimPlot2D is the same as spatDimPlot. So only in case you want to plot your spatial or dimension reduction data in 3D, you need to specifically say so.
# 1. standard R way
= spatPlot(mygobject, cell_color = 'cell_types')
pl pdf(file = 'path/to/save/to/plot.pdf')
print(pl)
dev.off()
# 2. indicate to save plot, this will save the plot according to Giotto instructions file
# If the instruction file is not provided in the beginning, it uses the defaults (e.g. working directory)
spatPlot(mygobject, cell_color = 'cell_types', save_plot = TRUE)
# 3. indicate to save plot and specifiy specific saving parameters by providing a list to save_param
# they will overrule the giotto instructions
spatPlot(mygobject, cell_color = 'cell_types', save_plot = TRUE,
save_param = list(save_folder = 'my_subfolder', save_name = 'my_name', save_format = 'png', units = 'in'))
# 4. don't save or return plot, but just view plot
# defaults are: save_plot = F, return_plot = T and show_plot = T
# this can be changed in the instructions file or at each specific plotting function
spatPlot(mygobject, cell_color = 'cell_types', save_plot = F, return_plot = F show_plot = T)