From 5c8845cf76d894c51227b2909861838df541d22c Mon Sep 17 00:00:00 2001 From: "Antonio, Fabio Di Narzo" Date: Wed, 28 Nov 2007 13:38:04 +0100 Subject: [PATCH] added separated (and up-to-date) plot.idmc_basin man page, upgraded examples --- RiDMC/R/basin.R | 2 +- RiDMC/man/Basin.Rd | 13 +++--------- RiDMC/man/plot.idmc_basin.Rd | 48 ++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 52 insertions(+), 11 deletions(-) create mode 100644 RiDMC/man/plot.idmc_basin.Rd diff --git a/RiDMC/R/basin.R b/RiDMC/R/basin.R index 5c79140..063ffc0 100644 --- a/RiDMC/R/basin.R +++ b/RiDMC/R/basin.R @@ -87,7 +87,7 @@ makeBasinsPalette <- function(values, color.attractors, color.basins, color.infi col } -grid.idmc_basin <- function(x, color.attractors, color.basins, +plot.idmc_basin <- function(x, y, color.attractors, color.basins, color.infinity, labels.attr, labels.bas, label.infty='infinity', main = getModelName(getBasinModel(x)), xlab = getModelVarNames(getBasinModel(x))[1], diff --git a/RiDMC/man/Basin.Rd b/RiDMC/man/Basin.Rd index 839a3b4..980cd78 100644 --- a/RiDMC/man/Basin.Rd +++ b/RiDMC/man/Basin.Rd @@ -1,7 +1,6 @@ \name{Basin} \alias{Basin} \alias{print.idmc_basin} -\alias{plot.idmc_basin} \title{ Computes basins of attraction for a 2-dim. discrete dynamical system } @@ -10,8 +9,6 @@ Basin(model, parms, xlim, xres=100, ylim, yres=100, attractorLimit, attractorIterations, method=c('fast', 'slow'), ntries, seed) \method{print}{idmc_basin}(x, ...) -\method{plot}{idmc_basin}(x, y, color.attractors, color.basins, - color.infinity, main, xlab, ylab, ...) } \arguments{ \item{model,x}{iDMC model object} @@ -23,12 +20,6 @@ Basin(model, parms, xlim, xres=100, ylim, yres=100, \item{method}{algorithm type} \item{ntries}{number of tries for finding attractors (only for 'slow' method)} \item{seed}{RNG seed (only for 'slow' method)} - \item{y}{unused} - \item{color.attractors}{vector of attractor colors} - \item{color.basins}{vector of basin colors} - \item{color.infinity}{color for basin of infinity} - \item{main}{plot title} - \item{xlab, ylab}{x and y axes labels} \item{...}{arguments to and from other methods} } \description{ @@ -66,7 +57,7 @@ m <- Model(exModelFile('henon')) system.time( b1 <- Basin(m, c(1.42,0.3), c(-2,2), 200, c(-2, 2), 200, 1000, 1000) ) -plot(b1) +plot(b1, legend=TRUE) ##Using the slow algorithm for a more complex model: m <- Model(exModelFile('cremona')) @@ -75,6 +66,8 @@ system.time( c(-1.2, 1.2), 300, 1000, 1000, method='slow', ntries=1000, seed=123) )##This takes about 8sec on my Turion-1800MHz plot(b2) +##A plot with no annotations: +plot(b2, axes=FALSE, xlab=NULL, ylab=NULL, main=NULL) ##Customizing palette #A simple case with just 1 attractor: diff --git a/RiDMC/man/plot.idmc_basin.Rd b/RiDMC/man/plot.idmc_basin.Rd new file mode 100644 index 0000000..db76d0f --- /dev/null +++ b/RiDMC/man/plot.idmc_basin.Rd @@ -0,0 +1,48 @@ +\name{plot.idmc_basin} +\alias{plot.idmc_basin} +\title{ +Computes basins of attraction for a 2-dim. discrete dynamical system +} +\usage{ +\method{plot}{idmc_basin}(x, y, color.attractors, color.basins, + color.infinity, labels.attr, labels.bas, label.infty='infinity', + main = getModelName(getBasinModel(x)), + xlab = getModelVarNames(getBasinModel(x))[1], + ylab = getModelVarNames(getBasinModel(x))[2], + axes=TRUE, legend=FALSE, ...) +} +\arguments{ + \item{x}{iDMC model object} + \item{y}{unused} + \item{color.attractors}{vector of attractor colors} + \item{color.basins}{vector of basin colors} + \item{color.infinity}{color for basin of infinity} + \item{main}{plot title (set to NULL for disabling)} + \item{xlab, ylab}{x and y axes labels (set to NULL for disabling)} + \item{labels.attr, labels.bas, label.infty}{labels for attractors, basins and infinity (only used in legend)} + \item{axes}{should axes be showed? (TRUE or FALSE)} + \item{legend}{should a legend be showed? (TRUE or FALSE)} + \item{...}{arguments to and from other methods} +} +\description{ +Plots basins of attraction of 2-dim. discrete dynamical system +} +\details{ +Plots basins of attraction of 2-dim. discrete dynamical system. + +You can optionally add a colors legend (\code{legend=TRUE}). +} +\value{ +none. As a side effect, a (grid) plot is produced on current graphical device +} +\author{ +Antonio, Fabio Di Narzo +} +\seealso{ +\code{\link{Basin}} +} +\examples{ +## +##See 'Basin' examples +## +} -- 2.11.4.GIT