Skip to contents

Replays what tda_read_ps parsed onto the current grid device, so a plot TDA produced appears in an R graphics device rather than only in a .ps file.

Usage

tda_plot_ps(x, newpage = TRUE, cex = NULL, ...)

Arguments

x

a path, a TDA run, or the result of tda_read_ps.

newpage

start a new page before drawing.

cex

character expansion for the text, relative to the size TDA asked for. The sizes in the file are PostScript points against a plot of perhaps 80mm; drawn into a device several times that, they come out small, so the default scales them with the drawing, times getOption("tdaR.ps.cex", 1).

...

passed to tda_read_ps.

Value

The parsed operations, invisibly.

Examples

# a PostScript file with something in it: five points on a quadratic.
# psetup needs its ranges -- axes alone draw nothing, and tda_plot_ps
# then has nothing to render.
r <- tda_run(c("nvar(noc = 5, X = case, Y = case * case);",
               "psfile = p.ps;",
               "psetup(pxlen = 90, pylen = 50, pxa = 0,6, pya = 0,30);",
               "plxa(sc = 1); plya(sc = 10); plframe;",
               "plot = X,Y;", "psclose;"))
p <- tda_plot_ps(file.path(r$dir, "p.ps"))