From J Wiki
Jump to: navigation, search
Plot | Verbs | Class Commands Data Options Outputs Types | Colors Fonts Keys Text YAxes | Function Multi Shape

The following is an overview of the plot source. To access this from the Project Manager, copy to the source into any directory, preserving subdirectories, and define a folder Plot that points to the source directory.

The source is in three subdirectories:

  • base has the core utilities
  • out has the output definitions (isi, eps and pdf)
  • type has code for the specific plot types, 2d and 3d

Main Subdirectories


This defines the core user function, pd .

Input commands are stored in the Pcmd command buffer, with minimal parsing.

Output commands activate drawing. These call output verbs isi_show , pdf_show etc. Output commands are not stored in Pcmd .


This defines the core plotting routine, make . This is called by the output verbs, with an argument of output type and plot size. Output type is used only for determining font metrics.

The output of make is a global Plot that defines the plot. The output verbs then step through this global to create the actual drawing.

make method:

1. the Pcmd block is split into new or use command blocks. Each such is drawn independently by makenew . 1. makenew first determines several values for the command block, including dimensions, data, axes, text.

These in turn are used to determine the plot decorations (labels, ticmarks etc).

Each command block is then split into type blocks, and each such is drawn by maketype .

maketype then sets the remaning plot options, and calculates the plots for each type.

Other Subdirectories

base\axis axis labels and ticmarks

base\font all font handling

base\key keys

base\layout main layout calculations, see Layout