But even if a supplied algorithm is well-matched to your needs, an effective display may need some fine-tuning, some manual repositioning of nodes. And when no Cytoscape algorithm is a good fit to your needs, you can get the job done by some combination of writing R code (creating a one-off layout, or perhaps inventing a new general-purpose layout) along with manual node placements. Those techniques are not covered here. Rather, this recipe shows what to do to save and reuse a layout once you have one you want.
Now you will see a 3-node, 3-edge graph in a Cytoscape window. Adjust these positions manually, as you might if you were working on a large network, and wanted the layout to be just right, perhaps a knowledge-based layout in which the knowledge is your own.
library (RCytoscape) cw = new.CytoscapeWindow ('save layout demo', makeSimpleGraph ()) displayGraph (cw) layoutNetwork (cw) redraw (cw)
At a later date, you can restore this layout precisely:
saveLayout (cw, 'someLayoutFileName')
See saveLayout and restoreLayout documentation.
restoreLayout (cw, 'someLayoutFileName')