2

When I save a tSNE plot with a large amount of points, I want to convert all the points in the plot to a PNG file while the remainder of the image (axes, labels, all text) remain as vector graphics. How could I do such things?

(I know that the Dimplot function in Seurat package can do this with parameter vector.friendly = TRUE)

zx8754
  • 52,746
  • 12
  • 114
  • 209
李子逸
  • 39
  • 2
  • Not sure if there is a ready tool for this, but we could output plot without axis as png image, then plot blank ggplot, then [add saved image to the plot](https://stackoverflow.com/questions/9917049). – zx8754 Nov 23 '18 at 13:47
  • 2
    This is what `seurat::dimplot` is doing, too, see [GitHub - L2450](https://github.com/satijalab/seurat/blob/65b77a9480281ef9ab1aa8816f7c781752092c18/R/plotting.R#L2450) and see [AugmentPlot function](https://github.com/satijalab/seurat/blob/7618ac8798e2aefc509529f07af9d2836b96a1be/R/plotting_utilities.R#L312). – zx8754 Nov 23 '18 at 13:55
  • Any reason why dimplot is not an option? – Roman Luštrik Nov 23 '18 at 14:07
  • Thank you, I think that plot ggplot with axis and text and then add a png image might be the best choice. The reason that not to use dimplot is that dimplot only use seurat object as an input, I want to avoid this. – 李子逸 Nov 24 '18 at 13:10

0 Answers0