Summary

reset

reset plot

sub,endsub

create sub window. All plots are drawn in sub windows. If there is no sub command, the sub window is taken to be the full plot area.

new,multi

start plot definition. new starts a single plot, multi starts a multiplot.

use

set the current plotting area.

rule,text,textc,textr

draw rule and text

show,isi,eps,pdf,pdfr,cavnas,canvasr,cairo,cairor

create and output plot

save,get,clip,print

copy plot to file, data stream, clipboard, printer

Drawing Commands

reset [parent] reset plot with optional parent window id.

For example:

pd 'reset' 

sub shape, endsub. Command sub starts a sub plot with given shape, sets plot defaults. Used for creating one or more plot windows. If sub is not used, the plot window is the available area.

The command is recursive - each call to sub starts a new sub plot in the existing window. Use command endsub to end a sub plot and return to the previous window.

For an isigraph plot, the default window is the full area of the isigraph control, which itself defaults to 480 x 360 pixels. For EPS and PDF plots, the default window depends on whether there is an active isigraph window displaying the current plot. If so, the window size is the same as the isigraph window, otherwise it is 0 0 480 360.

For example, create a new sub plot window with xy position 100 100, and of size 400 by 600:

pd 'sub 100 100 400 600'

multi shape starts a multiplot with the given shape. See Multi plots.

new [window] starts a new plot with an optional window definition, sets plot defaults. Use to set initial values, and when displaying multiple plots within the current sub window.

use window change window, leaving option settings unchanged. This does not restore plot defaults.

To draw several plots using the same options to a single sub window, start with pd 'new' for the first plot, and then pd 'use' for the subsequent plots.

[options] sets plot options. See plot Options.

For example:

pd 'backcolor white; frame 1' 

[data] sets plot data. See plot Data.

For example:

pd */~i:20 

rule arg draw line.

text, textc, textr arg text left aligned, centered, right aligned.

Argument is x y text, where x y are coordinates relative to the current window.

For example, the following writes the text "J Graphics" centered at position 500 950:

pd 'textc 500 950 J Graphics' 

See also Text commands.

Output commands

show [opts] display plot using the default output.

Output is isigraph in Jwdw or Jwdp, or GTK in JGTK, or canvas in JHS, otherwise PDF or cairo.

eps [file w h] display plot in EPS format.

The file defaults to ~temp\plot.eps. The [w h] is the EPS bounding box size, and defaults to the active plot window size in pixels, or 480 360 if none.

gtk display plot in a GTK window, where supported, requires GTK addon.

isi [w h] display plot in an isigraph window.

The [w h] are the pixels, and default to 480 360.

pdf [file w h] display plot in PDF format.

The file defaults to ~temp\plot.pdf. The [w h] is the PDF bounding box size, and defaults to the active plot window size in pixels, or 480 360 if none.

pdfr [w h] return plot as PDF stream.

The [w h] are the same as for pdf.

canvas [file w h context] display plot in HTML5 canvas element format.

The file defaults to ~temp\plot.html. The [w h] is the canvas bounding box size, and defaults to the active plot window size in pixels, or 400 200 if none. The [context] is a name for identifying the canvas element, only 2 javascript function will be returned if this option is set.

canvasr [w h context] return plot as HTML5 canvas element stream.

The [w h context] are the same as for canvas.

cairo [file w h] return plot in png format.

The file defaults to ~temp\plot.png. The [w h] is the image bounding box size, and defaults to the active plot window size in pixels, or 400 200 if none.

cairor [w h] return plot as png stream.

The [w h] are the same as for cairo.

See also Outputs.

Copy commands

The following commands copy an isigraph window, and require that an isigraph plot has already been created. To execute one of the copy commands silently, without first displaying the isigraph window, set the Plot option visible to 0. Note that generating an isigraph window uses the gl2 commands that are built into Jwd but not Jconsole. For this reason, it is not currently possible to use the copy commands from a Jconsole session.

clip copy isigraph plot to clipboard.

print print isigraph plot.

save type [options] save isigraph plot to file.

get type return isigraph plot as data stream.

Plot/Commands (last edited 2011-12-14 14:14:56 by BillLam)