# first, delete existing windows to save memory:
deleteAllWindows(CytoscapeConnection())
cw <- CytoscapeWindow ('saveLayout.test', graph=makeSimpleGraph())
displayGraph (cw)
layoutNetwork(cw, 'force-directed')
saveLayout (cw, 'layout.RData')
layoutNetwork(cw, 'fruchterman-rheingold')
restoreLayout (cw, 'layout.RData')
# you might need to adjust the zoom
saveLayout (cw, 'layout2', timestamp.in.filename=TRUE)
Run the code above in your browser using DataLab