# Saving and Printing

## Saving Sessions

Selecting Save or Save As... (depending on whether or not you wish to save to a new file) from the File menu allows you to save a &kst; session. This contains all of the plot and layout information which &kst; requires to reconstruct your session (as long as the data files used in the sessions are still present when &kst; is reopened!). 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

Vectors in &kst; can be exported. This can be useful, for example, if you would like to use a vector generated by &kst; in another application.

To export or save vectors to a file, select Save Vectors to Disk... from the File menu. A dialog will be displayed allowing you to choose which vectors to export.

Save Vectors to Disk
Save Vectors to Disk

You can select one or more vectors from the list, and click Save... to export them to an ASCII file. This file will contain the data in rows, with one column for each vector exported. The first two lines of this file are commented out with ; symbols. The first line contains the names of the exported vectors, and the second row is a visual separator.

Here is an example, for two 5 element vectors named HWYD and PWMY.

    ; HWYD PWMY
    ; ---------
    -2 4
    -1 1
    0 0
    1 1
    2 4

If you have selected multiple vectors to export, a drop down menu at the bottom of the Save Vectors to Disk dialog becomes enabled. There are three options available...

Truncate long vectors.

  All of the exported vectors will be truncated to match the length of the shortest vector selected.

Interpolate short vectors.

  All of the exported vectors will be interpolated to match the length of the longest vector selected.

Save in separate files.

  Each vector will be saved in a separate file. After hitting the Save... button you will be promted to enter a base file name, and then &kst; will save each selected vector in a separate file named by appending `.1`, `.2`, `.3`, ... to this base.

## Exporting Plot Images

To export a &kst; plot to a graphics file, select File Export to Graphics File... 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. The default name of graphic file is export.

File format

  The format to use for the saved graphics file. The drop down list shows you all the available formats. PNG is suggested if you are not sure which format to use. If you select EPS format, the Save EPS in vector format option becomes available, which allows you to save the image as a vector graphic which can be cleanly scaled later.

Size

  Select the dimensions, in pixels, of the graphic. The drop down list gives several self-explanatory options for specifying this size.

Tabs

  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:

Export to Graphics File
Export to Graphics File

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. If the monochrome options is selected the Configure... becomes enabled. Clicking this button allows you to tell &kst; how you would like curve appearance properties to be cycled through. This can compensate for the colour information which is lost in monochrome printing.

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.