# Saving and Printing

&kst; provides various methods of saving and exporting data and plots. These methods are described below.

## Saving Plot Definitions

A plot definition is essentially a capture of a &kst; session. It contains all the plots, data objects, and plot layouts that are present at the time of saving.

To save a plot definition, simply select Save or Save As... (depending on whether or not you wish to save to a new file) from the File menu. Browse to the location you wish to save the plot definition, enter a filename, and click Save. The plot definition will be saved as a `*.kst` file.

## Exporting Vectors and Plots

Vectors and plots in &kst; can be exported to files. This can be useful, for example, in capturing plots of live data or using generated vectors in a different application.

### Exporting Vectors

To export or save a vector to a file, select Save Vectors to Disk... from the File menu. The vector will be saved as an ASCII data file. The single column of the file will contain the elements of the selected vector. See below for an example of an exported vector.

    3776
    5380
    5245
    2942
    1861
    2424
    2520
    1868
    1736
    1736
    1174
    499

### Exporting Plots

To export a &kst; plot to a graphics file, select Export to Graphics File... from the File menu. The following dialog box will appear.

Export to Graphics File
Export to Graphics File

The following settings and options are available when saving:

Save location

  The path to the graphics file. Enter a location manually, or click the button to right of the text box to browse to a location.

File Format

  The format to use for the saved graphics file. PNG is suggested if you are not sure which format to use.

Size

  Select the dimensions, in pixels, of the graphic. Check the Square option if you wish for the length and width of the graphic to be equal.

Windows

  Select whether to export only the plots in the current window, or all plots. If All is selected, one graphics file will be created for each window, each with filename `file_n.fmt`, where `file` is the filename specified in Save location, `n` is an index number assigned to each window, and fmt is an extension representing the selected file format.

Autosave

  Check this option if you want &kst; to automatically save the plot to the specified file on a specified time interval.

Save interval

  The time interval used to perform autosave, in seconds.

Click Save Once to immediately perform a save with the specified options and settings. Click Close to close the dialog box (autosave will still be performed at the specified intervals, if selected).

## Printing

To print all the plots in the current window, select Print... from the File menu. A standard &kde; print dialog will be displayed. Some &kst;-specific options can be set by clicking on the Options >> button, and selecting the Kst Options tab. The options are:

Append plot information to each page

  If selected, a footer showing page number, plot name and the date and time is printed on each page.

Maintain aspect ratio

  If selected, the aspect ratio of the plots in the &kst; window is retained in the print output. If unselected, the plots are resized to fill the printed page in both directions.

Print in monochrome

  If selected, the plot is printed in monochrome (black-and-white). If not, the colors of the on-screen plot are used.

Curve width adjustment

  Adjusts the width of all curves in the printed output by this number of pixels relative to the width of the curve in the plot window. You can set a negative value to reduce the width of the curves in the print output.