Bsoft 2.1.4
Bernard's software package
ps_plot.cpp File Reference

Postscript output functions. More...

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

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...
 
Bplotps_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...
 
Bplotplot_curve (long nrow, double *c0, double *c1, double *c2, double *c3)
 Generates 1-3 line plot. More...
 
int ps_define_arrowline (ofstream *fps)
 Generates an arrow and line. More...
 

Variables

int verbose
 
string command
 

Detailed Description

Postscript output functions.

Author
Bernard Heymann
Date
Created: 20010515
Modified: 20200312

Function Documentation

◆ plot_curve()

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

Generates 1-3 line plot.

Parameters
nrownumber of points.
*c0independent variable.
*c1curve 1.
*c2curve 2.
*c3curve 3.
Returns
Bplot* plot structure.

◆ ps_close()

int ps_close ( ofstream *  fps)

Closes a postscript file.

Parameters
*fpsfile handle.
Returns
int 0.
Closes a file and writes the postscript trailer line.

◆ ps_define_arrowline()

int ps_define_arrowline ( ofstream *  fps)

Generates an arrow and line.

◆ ps_graph()

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

Generates postscript graphs.

Parameters
*fpsoutput postscript file descriptor.
*plotplot information.
page_numberpage number (starts at 1).
Returns
int 0, <0 on error.
Any number of functions of a single independant variable (x) can be plot.

◆ ps_open_and_init() [1/2]

ofstream * ps_open_and_init ( Bstring  filename,
Bplot plot 
)

Opens and initializes a postscript file.

Parameters
&filenameoutput postscript file name.
*plotplot 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.

◆ ps_open_and_init() [2/2]

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

Opens and initializes a postscript file.

Parameters
&filenameoutput postscript file name.
&titletitle.
npagesnumber of pages.
widthpage width.
heightpage 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.

◆ ps_plot()

int ps_plot ( Bstring  filename,
Bplot plot 
)

Generates postscript graphs.

Parameters
&filenameoutput postscript file name.
*plotplot information.
Returns
int 0, <0 on error.
Any number of functions of a single independant variable (x) can be plot.

◆ ps_read()

Bplot * ps_read ( Bstring filename)

Reads a postscript file with a data table.

Parameters
&filenameinput postscript file name.
Returns
Bplot* new plot.

◆ 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
*fpspostscript file descriptor.
x1starting x coordinate.
y1starting y coordinate.
x2ending x coordinate.
y2ending y coordinate.
minminimum value.
maxmaximum value.
incrementvalue increment.
tick_lengthlength of ticks.
tick_angleangle of ticks relative to horizontal axis.
digitsnumber of decimal digits for labels.
fontsizefont size for labels.
inverseflag for inverse values.
Returns
int 0.

Variable Documentation

◆ command

string command
extern

◆ verbose

int verbose
extern