Plot.save

save(plot, filename, size=None, **kwargs)

Save a plot to a file.

Save can save the full, interactive plot. This is done by supplying a filename with the HDF5 file extension. The plot can then later be loaded by using the standard nlread function.

Save also supports rendering of the plot to SVG, PNG, JPEG or PDF. Simply pass in a filename with the appropriate file extension. Note that this requires full graphical support for the NanoLab GUI. This support can be lacking on clusters or computing nodes. When generating plots on a computing node, they must then be saved in HDF5 files. The plots can then be rendered to SVG, PNG, JPEG or PDF on a machine with the proper graphical support.

Parameters:
  • plot (BaseLayout based | PlotModel) – The plot to save.

  • filename (str) – The filename.

  • size (NoneType | 2-tuple of ints) – The plot size in pixels.

  • **kwargs (dict) – Additional arguments passed on to matplotlib when saving a figure.