| Bsoft 2.0.5 Bernard's software package

Functions | Variables
ps_plot.cpp File Reference

Postscript output functions. More...

`#include "ps_plot.h"`
`#include "utilities.h"`
`#include <time.h>`

Go to the source code of this file.

## Functions
ofstream * | ps_open_and_init (Bstring filename, Bstring title, int npages, int width, int height)
| Opens and initializes a postscript file. More...
ofstream * | ps_open_and_init (Bstring filename, Bplot *plot)
| Opens and initializes a postscript file. More...
int | ps_close (ofstream *fps)
| Closes a postscript file. More...
int | ps_plot (Bstring filename, Bplot *plot)
| Generates postscript graphs. More...
Bplot * | ps_read (Bstring &filename)
| Reads a postscript file with a data table. More...
int | ps_graph (ofstream *fps, Bplot *plot, int page_number)
| Generates postscript graphs. More...
int | ps_scale (ofstream *fps, double x1, double y1, double x2, double y2, double min, double max, double increment, double tick_length, double tick_angle, int digits, int fontsize, int inverse)
| Generates a scale for a postscript graph. More...
Bplot * | plot_curve (long nrow, double *c0, double *c1, double *c2, double *c3)
| Generates 1-3 line plot. More...

## Variables
int | verbose

## Detailed Description

Postscript output functions.

Author
  Bernard Heymann

Date
  Created: 20010515
  Modified: 20171124

Definition in file ps_plot.cpp.

## Function Documentation

## ◆ plot_curve()

Bplot* plot_curve | ( | long | nrow,
|  | double * | c0,
|  | double * | c1,
|  | double * | c2,
|  | double * | c3
| ) |  |

Generates 1-3 line plot.

Parameters

  nrow | number of points.
  *c0 | independent variable.
  *c1 | curve 1.
  *c2 | curve 2.
  *c3 | curve 3.

Returns
  Bplot* plot structure.

Definition at line 557 of file ps_plot.cpp.

## ◆ ps_close()

int ps_close | ( | ofstream * | fps | ) |

Closes a postscript file.

Parameters

  *fps | file handle.

Returns
  int 0.

      Closes a file and writes the postscript trailer line.

Definition at line 104 of file ps_plot.cpp.

## ◆ ps_graph()

int ps_graph | ( | ofstream * | fps,
|  | Bplot * | plot,
|  | int | page_number
| ) |  |

Generates postscript graphs.

Parameters

  *fps | output postscript file descriptor.
  *plot | plot information.
  page_number | page number (starts at 1).

Returns
  int 0, <0 on error.

      Any number of functions of a single independant variable (x) can be plot.

Definition at line 246 of file ps_plot.cpp.

## ◆ ps_open_and_init() [1/2]

ofstream* ps_open_and_init | ( | Bstring | filename,
|  | Bstring | title,
|  | int | npages,
|  | int | width,
|  | int | height
| ) |  |

Opens and initializes a postscript file.

Parameters

  &filename | output postscript file name.
  &title | title.
  npages | number of pages.
  width | page width.
  height | page height.

Returns
  ofstream* postscript file descriptor.

      Opens a stream and writes the postscript header line, the creator and
      creation date lines, and a document data specifier.

Definition at line 31 of file ps_plot.cpp.

## ◆ ps_open_and_init() [2/2]

ofstream* ps_open_and_init | ( | Bstring | filename,
|  | Bplot * | plot
| ) |  |

Opens and initializes a postscript file.

Parameters

  &filename | output postscript file name.
  *plot | plot information.

Returns
  ofstream* postscript file stream.

      Opens a file and writes the postscript header line, the creator and
      creation date lines, and a document data specifier.

Definition at line 69 of file ps_plot.cpp.

## ◆ ps_plot()

int ps_plot | ( | Bstring | filename,
|  | Bplot * | plot
| ) |  |

Generates postscript graphs.

Parameters

  &filename | output postscript file name.
  *plot | plot information.

Returns
  int 0, <0 on error.

      Any number of functions of a single independant variable (x) can be plot.

Definition at line 128 of file ps_plot.cpp.

## ◆ ps_read()

Bplot* ps_read | ( | Bstring & | filename | ) |

Reads a postscript file with a data table.

Parameters

  &filename | input postscript file name.

Returns
  Bplot* new plot.

Definition at line 148 of file ps_plot.cpp.

## ◆ ps_scale()

int ps_scale | ( | ofstream * | fps,
|  | double | x1,
|  | double | y1,
|  | double | x2,
|  | double | y2,
|  | double | min,
|  | double | max,
|  | double | increment,
|  | double | tick_length,
|  | double | tick_angle,
|  | int | digits,
|  | int | fontsize,
|  | int | inverse
| ) |  |

Generates a scale for a postscript graph.

Parameters

  *fps | postscript file descriptor.
  x1 | starting x coordinate.
  y1 | starting y coordinate.
  x2 | ending x coordinate.
  y2 | ending y coordinate.
  min | minimum value.
  max | maximum value.
  increment | value increment.
  tick_length | length of ticks.
  tick_angle | angle of ticks relative to horizontal axis.
  digits | number of decimal digits for labels.
  fontsize | font size for labels.
  inverse | flag for inverse values.

Returns
  int 0.

Definition at line 487 of file ps_plot.cpp.

## Variable Documentation

## ◆ verbose

int verbose