<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
<!DOCTYPE MAN SYSTEM "../../manrev.dtd">
<MAN>
  <LANGUAGE>eng</LANGUAGE>

  <TITLE>xsave</TITLE>

  <TYPE>Scilab Function</TYPE>

  <DATE>April 1993</DATE>

  <SHORT_DESCRIPTION name="xsave">save graphics into a
  file</SHORT_DESCRIPTION>

  <CALLING_SEQUENCE>
    <CALLING_SEQUENCE_ITEM>xsave(filename,[win_num])</CALLING_SEQUENCE_ITEM>
  </CALLING_SEQUENCE>

  <PARAM>
    <PARAM_INDENT>
      <PARAM_ITEM>
        <PARAM_NAME>file_name</PARAM_NAME>

        <PARAM_DESCRIPTION>
          <SP>: string, name of the file.</SP>
        </PARAM_DESCRIPTION>
      </PARAM_ITEM>

      <PARAM_ITEM>
        <PARAM_NAME>win_num</PARAM_NAME>

        <PARAM_DESCRIPTION>
          <SP>: integer, the graphics window number. If not given, the current
          graphics window is used.</SP>
        </PARAM_DESCRIPTION>
      </PARAM_ITEM>
    </PARAM_INDENT>
  </PARAM>

  <DESCRIPTION>
    <P><VERB>xsave</VERB> saves the graphics contained in the graphics window
    <VERB>win_num</VERB> in the binary file <VERB>file_name</VERB>. and can be
    reloaded with <VERB>xload</VERB>.</P>

    <P>For new graphics <VERB>xsave(file_name,win_num)</VERB> use preferabily
    <VERB>save(file_name,scf(win_num))</VERB>.</P>
  </DESCRIPTION>

  <EXAMPLE><![CDATA[

    //new style
    set figure_style new
    t=0:0.01:10;
    subplot(211),plot2d(t,sin(t))
    subplot(212),plot2d(t,sin(3*t))
    save(TMPDIR+'/foo.scg',gcf())
    clf()
    load(TMPDIR+'/foo.scg')
    
    a=gca();
    curve=a.children.children; //handle on the curve
    save(TMPDIR+'/foo.scg',curve)
    delete(curve)
    load(TMPDIR+'/foo.scg')
    

    //old style
    set figure_style old
    t=0:0.01:10;
    subplot(211),plot2d(t,sin(t))
    subplot(212),plot2d(t,sin(3*t))
    xsave(TMPDIR+'/foo.scg')
    xbasc()
    set figure_style old
    xload(TMPDIR+'/foo.scg')


 
  ]]></EXAMPLE>

  <SEE_ALSO>
    <SEE_ALSO_ITEM>
      <LINK>xload</LINK>
    </SEE_ALSO_ITEM>

    <SEE_ALSO_ITEM>
      <LINK>save</LINK>
    </SEE_ALSO_ITEM>

    <SEE_ALSO_ITEM>
      <LINK>load</LINK>
    </SEE_ALSO_ITEM>
  </SEE_ALSO>

  <AUTHOR>J.Ph.C.</AUTHOR>
</MAN>