Scilab Home page | Wiki | Bug tracker | Forge | Mailing list archives | ATOMS | File exchange
Please login or create an account
Change language to: English - Português - 日本語 - Русский
Aide de Scilab >> Graphiques > load_save > xsave

xsave

save graphics into a file

Syntax

xsave(filename)
xsave(filename, win_num)
xsave(filename, win_handle)

Arguments

file_name
string, name of the file.

win_num
integer: the graphics window number. If not given, the current graphics window is considered.

win_handle
handle of the figure to save. By default, gcf() is used.

Description

xsave saves the graphics contained in the graphics window win_num in the binary file file_name, and can be reloaded with xload.

xsave(file_name, win_num) and xsave(file_name, win_handle) are just shortcuts respectively for h=findobj("figure_id", win_num); save(file_name, "h") and save(file_name, "win_handle"), that can be used directly.

Examples

t = 0:0.01:10;
subplot(211), plot2d(t,sin(t))
subplot(212), plot2d(t,sin(3*t))
xsave(TMPDIR + "/foo.scg", gcf())
clf()
xload(TMPDIR + "/foo.scg")

a = gca();
curve = a.children.children; // handle on the curve
save(TMPDIR + "/foo.scg", "curve")
delete(curve)
load(TMPDIR + "/foo.scg")

See also

  • xload — displays in a given window some graphical component loaded from a file.

History

VersionDescription
5.0 All uimenu and uicontrol elements of the figure are now saved as well.
Scilab Enterprises
Copyright (c) 2011-2017 (Scilab Enterprises)
Copyright (c) 1989-2012 (INRIA)
Copyright (c) 1989-2007 (ENPC)
with contributors
Last updated:
Tue Jul 20 11:19:20 CEST 2021