Bioplib
Protein Structure C Library
|
PostScript plotting routines. More...
#include <stdio.h>
#include <string.h>
#include <math.h>
#include <time.h>
#include <ctype.h>
#include "MathType.h"
#include "SysDefs.h"
#include "plotting.h"
#include "general.h"
#include "ps.h"
Go to the source code of this file.
Macros | |
#define | MAXBUFF 160 |
#define | _PS_MAIN |
Functions | |
BOOL | blPSInit (char *FName, char *creator, char *AltFont) |
void | blPSThick (REAL thickness) |
void | blPSMove (REAL X, REAL Y) |
void | blPSDraw (REAL X, REAL Y) |
void | blPSSetDash (char *linepatt) |
void | blPSClearDash (void) |
void | blPSStroke (void) |
void | blPSFont (char *fontname, REAL size) |
void | blPSLText (REAL X, REAL Y, char *label) |
void | blPSCBText (REAL X, REAL Y, REAL Offset, char *label) |
void | blPSROffText (REAL X, REAL Y, REAL offset, char *label) |
void | blPSLCText (REAL X, REAL Y, char *label) |
void | blPSCTText (REAL X, REAL Y, REAL Offset, char *label) |
void | blPSVText (REAL x, REAL y, REAL xoff, char *text, char *font, REAL size, char *label, char *lfont, REAL lsize) |
void | blPSShowText (char *text) |
void | blPSEnd (void) |
char * | blPSCorrectCase (char *font) |
PostScript plotting routines.
This code is NOT IN THE PUBLIC DOMAIN, but it may be copied according to the conditions laid out in the accompanying file COPYING.DOC.
The code may be modified as required, but any modifications must be documented so that the person responsible can be identified.
The code may not be sold commercially or included as part of a commercial product except as described in the file COPYING.DOC.
These routines supply rudimentry PostScript support with simple commands from C.
This version does not support EPSF.
You should #include "ps.h" in your program and assign values to the global variables PSxpicsize,PSypicsize,PSxoffset and PSyoffset. All these values are in inches. Your plot should then run between 0.0 and 1.0 (you need to look after scaling to fit within these boundaries yourself).
Start with a call to PSInit which will set up the scaling and other routines within the PostScript program.
Definition in file ps.c.
[in] | X | X coordinate |
[in] | Y | Y coordinate |
[in] | Offset | Y offset - multiple of font height. Moves up by this quantity |
[in] | *label | Text to be printed |
Centers a piece of text with X,Y being the Coords of the BOTTOM centre point
void blPSClearDash | ( | void | ) |
char* blPSCorrectCase | ( | char * | font | ) |
[in] | X | X coordinate |
[in] | Y | Y coordinate |
[in] | Offset | Y offset in points. Moves down by this quantity |
[in] | *label | Text to be printed |
Centers a piece of text with X,Y being the Coords of the TOP centre point
void blPSEnd | ( | void | ) |
void blPSFont | ( | char * | fontname, |
REAL | size | ||
) |
[in] | *fontname | Font to set |
[in] | size | Point size of font |
Set the font and size
BOOL blPSInit | ( | char * | FName, |
char * | creator, | ||
char * | AltFont | ||
) |
[in] | *FName | PostScript filename |
[in] | *creator | Creator string |
[in] | *AltFont | Alternate font (normall greek style) |
Initialises the file writing the Prologue. The filename and creator are written into the Prologue and EPSFxoff and EPSFyoff are used to calculate the bounding box size for EPSF plots.
[in] | X | X coordinate |
[in] | Y | Y coordinate |
[in] | *label | Text to be printed |
Left justify text, centred on Y
[in] | X | X coordinate |
[in] | Y | Y coordinate |
[in] | offset | X offset in points; text moved to the left by this amount |
[in] | *label | Text to be printed |
Right justify text with offset in device coordinates (points).
void blPSSetDash | ( | char * | linepatt | ) |
void blPSShowText | ( | char * | text | ) |
void blPSStroke | ( | void | ) |
void blPSThick | ( | REAL | thickness | ) |
void blPSVText | ( | REAL | x, |
REAL | y, | ||
REAL | xoff, | ||
char * | text, | ||
char * | font, | ||
REAL | size, | ||
char * | label, | ||
char * | lfont, | ||
REAL | lsize | ||
) |
[in] | x | X coordinate (in data units) |
[in] | y | Y coordinate (in data units) |
[in] | xoff | X-offset in pts |
[in] | *text | Text to be written |
[in] | *font | Font in which to write it |
[in] | size | Size of font |
[in] | *label | Label to be used to calc x offset |
[in] | *lfont | Font of this label |
[in] | lsize | Size of this label |
Write vertical text centred on x,y offset back along x by the size of label and by xoff in pts. Used, for example, to title the y-axis of a graph. The `label' specification is used to calculate an amount by which to move the text back. Typically this would be the longest data label on the graph's Y-axis.