Bsoft  2.1.0
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>

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...
 
int ps_define_arrowline (ofstream *fps)
 Generates an arrow and line. More...
 

Variables

int verbose
 

Detailed Description

Postscript output functions.

Author
Bernard Heymann
Date
Created: 20010515
Modified: 20200312

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
nrownumber of points.
*c0independent variable.
*c1curve 1.
*c2curve 2.
*c3curve 3.
Returns
Bplot* plot structure.

Definition at line 561 of file ps_plot.cpp.

◆ 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.

Definition at line 105 of file ps_plot.cpp.

◆ ps_define_arrowline()

int ps_define_arrowline ( ofstream *  fps)

Generates an arrow and line.

Definition at line 602 of file ps_plot.cpp.

◆ 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.

Definition at line 247 of file ps_plot.cpp.

◆ 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.

Definition at line 70 of file ps_plot.cpp.

◆ 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.

Definition at line 32 of file ps_plot.cpp.

◆ 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.

Definition at line 129 of file ps_plot.cpp.

◆ ps_read()

Bplot* ps_read ( Bstring &  filename)

Reads a postscript file with a data table.

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

Definition at line 149 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
*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.

Definition at line 488 of file ps_plot.cpp.

Variable Documentation

◆ verbose

int verbose
extern