Warning, /graphics/kst-plot/docbook/kst/saving-chapter.docbook is written in an unsupported language. File is not indexed.

0001 <chapter id="savingandexporting">
0002 <title>Saving and Printing</title>
0003 <sect1>
0004 <title>Saving and Exporting</title>
0005 <para>
0006 &kst; provides various methods of saving and exporting data and plots.  These methods are described below.
0007 </para>
0008 
0009 <itemizedlist>
0010 
0011   <listitem>
0012     <para>
0013       <link linkend="save-sessions">Session Files</link>: A capture of the entire &kst; session can be saved for future use.
0014     </para>
0015   </listitem>
0016 
0017   <listitem>
0018     <para>
0019       <link linkend="save-vectors">Exporting Vectors</link>: The numerical values of one or more vectors can be written out to an ASCII file.
0020     </para>
0021   </listitem>
0022 
0023   <listitem>
0024     <para>
0025       <link linkend="print">Printing Tabs</link>: One or more of the current tabs can be printed.
0026     </para>
0027   </listitem>
0028 
0029   <listitem>
0030     <para>
0031       <link linkend="exportinggraphics">Exporting Tabs</link>: One or more of the current tabs can be saved to an image file (eg, a png or svg file).
0032     </para>
0033   </listitem>
0034 
0035     <listitem>
0036     <para>
0037       Copy Tab Image: A bitmap image of the current tab contents can be saved to the clipboard for pasting into an other application by Selecting <guimenuitem>Copy Tab Image</guimenuitem> from the <guimenu>Edit</guimenu>.  The image will have the dimensions (in pixels) of the tab in the kst window.
0038     </para>
0039   </listitem>
0040 
0041 </itemizedlist>
0042 </sect1>
0043 
0044 <sect1 id="save-sessions">
0045 <title>Session Files</title>
0046 
0047 <sect2>
0048 <title>Saving</title>
0049 
0050 <para>
0051   Selecting <guimenuitem>Save</guimenuitem> or <guimenuitem>Save As</guimenuitem> from the <guimenu>File</guimenu> menu will save the state of the current kst session.  By default, these session files have the extensions <literal>.kst</literal>.  If this session file is opened later, the state of kst, including the loading of all data files, and the saving of all plots will be returned to the state when it was saved.
0052 </para>
0053 
0054 </sect2>
0055 
0056 <sect2>
0057 <title>Loading</title>
0058 <para>
0059   Session files are loaded by:
0060 </para>
0061 <itemizedlist>
0062   <listitem>
0063     <para>
0064       Selecting <guimenuitem>Open</guimenuitem> from the <guimenu>File</guimenu> menu.
0065     </para>
0066   </listitem>
0067 
0068   <listitem>
0069     <para>
0070       Selecting one of the session files in the <guimenu>Recent Sessions</guimenu> submenu in the <guimenu>File</guimenu> menu.
0071     </para>
0072   </listitem>
0073 
0074   <listitem>
0075     <para>
0076       Selecting one of the sessions listed at the bottom of the <guimenu>File</guimenu> menu.
0077     </para>
0078   </listitem>
0079 
0080   <listitem>
0081     <para>
0082       using the commend line. For example:
0083       <screen><userinput><command>kst2 sessionfile.kst</command></userinput></screen>
0084     </para>
0085   </listitem>
0086 </itemizedlist>
0087 
0088 
0089 </sect2>
0090 
0091 <sect2>
0092 <title>Details</title>
0093 <para>
0094   There are a few details to be aware of with sessions files:
0095 </para>
0096 
0097 <itemizedlist>
0098 
0099   <listitem>
0100     <para>
0101       Data read from data source files are not embedded in the kst session file.  Instead, the file name and frame ranges are stored, and when the session is loaded, the data files are re-loaded from the data source file.  If the the data source files have been moved or deleted, then loading will fail.  If the contents of the data source files have changed, then the data loaded will be whatever is now in the data file.
0102     </para>
0103   </listitem>
0104 
0105   <listitem>
0106     <para>
0107       Vectors which have been created from numpy arrays through the python interface are embedded in the data file, so reloading the session reloads the vectors that have been copied through pyKst.
0108     </para>
0109   </listitem>
0110 
0111   <listitem>
0112     <para>
0113       When a session file is loaded, the current session is cleared.
0114     </para>
0115   </listitem>
0116 
0117   <listitem>
0118     <para>
0119       When a session file is loaded, the undo stack is cleared.
0120     </para>
0121   </listitem>
0122 
0123 
0124 </itemizedlist>
0125 
0126 </sect2>
0127 </sect1>
0128 
0129 <sect1 id="save-vectors">
0130 <title>Exporting Vectors</title>
0131 <para>
0132 Vectors in &kst; can be exported to ascii files.
0133 To export or save a vector to a file, select <guimenuitem>Save Vectors to Disk...</guimenuitem>
0134 from the <guimenu>File</guimenu> menu.  From the <guilabel>Export Vectors</guilabel> dialog, select the
0135 vectors you want to export, and select the file name where you want to save it.  In the dialog example,
0136 below, <literal>gyro\_x</literal> and <literal>t\_rw</literal> have been selected.
0137 </para>
0138 
0139 <screenshot>
0140 <screeninfo>Export Vectors</screeninfo>
0141 <mediaobject>
0142 <imageobject>
0143 <imagedata fileref="Screenshot-kst-exportvectors.png" format="PNG" />
0144 </imageobject>
0145 <textobject>
0146 <phrase>Export Vectors to an ASCII file</phrase>
0147 </textobject>
0148 </mediaobject>
0149 </screenshot>
0150 
0151 <para>
0152   The vectors will be saved to an ascii file.  Each field is in a separate column, and the first row lists the field names.  If the vectors are of different lengths, then the shorter ones will be linearly interpolated to be the same size as the largest one, with the first and last samples of each vector assumed to be simultaneous.
0153 </para>
0154 </sect1>
0155 
0156 <sect1 id="print">
0157 <title>Printing Tabs</title>
0158 <para>
0159 Printing works as expected.  
0160 </para>
0161 <para>
0162 To print, select <guimenuitem>Print...</guimenuitem> from the <guimenu>File</guimenu> menu.  A system print dialog will be displayed.  By default, all tabs will be printed.  
0163 </para>
0164 <para>
0165 If the OS supports it, the plots can be exported here to a pdf file.  Otherwise, you can use the <link linkend="exportinggraphics">Exporting Tabs</link> option described in the next section to export to a pdf file.
0166 </para>
0167 <para>
0168   Each page will be rescaled to fit whatever page size and orientation has been selected.  The scaling and resizing rules are the same when a &kst; window is resized.  If the page is the same size as has been set as the <guilabel>Reference view size</guilabel> (under <guilabel>Scaling</guilabel> in the <guilabel>Kst Settings</guilabel> dialog, selected by <guimenuitem>Configure Kst</guimenuitem> from the <guimenu>Settings</guimenu> menu), then the fonts will all have the sizes they have been set to in the various dialogs.  If the selected print size is larger or smaller than this, then the fonts will be also be proportionally larger or smaller.
0169 </para>
0170 </sect1>
0171 
0172 <sect1 id="exportinggraphics">
0173 <title>Exporting Tabs</title>
0174 <para>
0175 To export &kst; plots to a graphics file, select <guimenuitem>Export as Image(s)...</guimenuitem>
0176 from the <guimenu>File</guimenu> menu.  The following dialog box will appear.
0177 </para>
0178 <screenshot>
0179 <screeninfo>Export to Graphics File</screeninfo>
0180 <mediaobject>
0181 <imageobject>
0182 <imagedata fileref="Screenshot-kst-exportgraphics.png" format="PNG" />
0183 </imageobject>
0184 <textobject>
0185 <phrase>Export to Graphics File</phrase>
0186 </textobject>
0187 </mediaobject>
0188 </screenshot>
0189 
0190 <para>
0191   The root file name is specified in the <guilabel>File name:</guilabel> entry.  If <guilabel>Automatic extension</guilabel> is selected, then the file name extension appropriate to the file type is automatically added to the file name.
0192 </para>
0193 
0194 <para>
0195   If <guilabel>Export all tabs</guilabel> is selected, then all tabs will be saved in separate files using the rules suggested in the label.  So, for example, if the file name selected in <guilabel>File name:</guilabel> is "demo", the file type is png, and <guilabel>Automatic extension</guilabel> is selected, and there are three tabs, then the three tabs will be saved in "demo_View1.png", "demo_View2.png", and "demo_View3.png".
0196 </para>
0197 
0198 <para>
0199   SVG images, as well all file types supported by QImage are supported by kst.  This includes most common output formats.  For vector formats, such as SVG, the output, including text, is in vector format.  The <guilabel>Include:</guilabel> <guilabel>Vector formats</guilabel> and <guilabel>Bitmap formats</guilabel> checkboxes select what file types are listed in the <guilabel>File format</guilabel> list to make selection easier.
0200 </para>
0201 
0202 <para>
0203   The size of the output image is specified in pixels.  The <guilabel>Specify</guilabel> selection has 4 options: In order to preserve the aspect ratio of the on-screen window, the <guilabel>Width and Maintain Aspect Ratio</guilabel> or <guilabel>Height and Maintain Aspect Ratio</guilabel> options can be chosen.  The other two options are to specify the <guilabel>Width and Height</guilabel> of the output files, or if you want the output to be a Square, to specify the <guilabel>Size of Square</guilabel>.
0204 </para>
0205 
0206 <para>
0207   In the <guilabel>Save Options</guilabel> section, if <guibutton>Save Once</guibutton> is selected, the imaged will be saved with the specified options and settings when <guibutton>Ok</guibutton> or <guibutton>Apply</guibutton> are pressed. 
0208 </para>
0209 
0210 <para>
0211   If, instead, you would like to output the image at repeated intervals, say for providing a dynamic image for a web page, then select <guibutton>Autosave every</guibutton> and input the desired time between images (note that this is the time to wait after the previous image is complete, and not a high precision timer).  Once either the <guibutton>Ok</guibutton> or <guibutton>Apply</guibutton> buttons are pressed, &kst; will begin performing an image export to the specified file names at the interval selected, silently overwriting the existing files.  This will continue until <guilabel>Save Once</guilabel> is selected and the tabs are exported, or &kst; is exited.  A web page based on this is, admittedly, a little hacky, as it can be subject to displaying partial images if the write is not complete, but it does make for a very quick and easy way of making a kst session viewable remotely.
0212 </para>
0213 
0214 </sect1>
0215 
0216 </chapter>
0217 
0218 
0219 <!-- Keep this comment at the end of the file
0220 Local variables:
0221 mode: xml
0222 sgml-omittag:nil
0223 sgml-shorttag:nil
0224 sgml-namecase-general:nil
0225 sgml-general-insert-case:lower
0226 sgml-minimize-attributes:nil
0227 sgml-always-quote-attributes:t
0228 sgml-indent-step:0
0229 sgml-indent-data:true
0230 sgml-parent-document:("index.docbook" "book" "chapter")
0231 sgml-exposed-tags:nil
0232 sgml-local-catalogs:nil
0233 sgml-local-ecat-files:nil
0234 End:
0235 -->