Learn R Programming

RCy3 (version 1.2.0)

saveImage: saveImage

Description

Write an image of the specified type to the specified file, at the specified scaling factor. Note: the file is written to the file system of the computer upon which R is running, not Cytoscape -- in those cases where they are different. It is saved to the working directory.

Usage

saveImage(obj, file.name, image.type, scale)

Arguments

obj
a CytoscapeWindowClass object.
file.name
a char object. Use an explicit, full path, or this file will be written into your home directory.
image.type
a char object. 'jpg' is the only image type currently supported
scale
a numeric object. How large (or small) to scale the image.

Value

None.

See Also

selectNodes clearSelection

Examples

Run this code
  # first, delete existing windows to save memory:
  deleteAllWindows(CytoscapeConnection())

  cw <- CytoscapeWindow ('saveImage.test', graph=makeSimpleGraph())
  displayGraph (cw)
  layoutNetwork(cw, 'force-directed')
  redraw (cw)
  filename <- paste (getwd (), 'saveImageTest', sep='/')
  saveImage (cw, filename, 'svg', 2.0)   # currently supports svg, pdf and png

Run the code above in your browser using DataLab