plot.motbf: Plots for "motbf" objects

View source: R/plots.R

plot.motbfR Documentation

Plots for 'motbf' objects

Description

Draws an 'motbf' function.

Usage

## S3 method for class 'motbf'
plot(x, ...)

## S3 method for class 'univmotbf'
plot(x, xlim = NULL, ylim = NULL, type = "l", add = FALSE, ...)

## S3 method for class 'piecewisemop'
plot(x, xlim = NULL, ylim = NULL, ...)

## S3 method for class 'motbf.fit.node'
plot(x, panels = TRUE, ...)

## S3 method for class 'jointmotbf'
plot(
  x,
  type = "contour",
  ranges = NULL,
  orientation = c(5, -30),
  data = NULL,
  filled = TRUE,
  ticktype = "simple",
  main = NULL,
  ...
)

Arguments

x

An object of class 'motbf' or one of its subclasses ('univmotbf', 'piecewisemop', 'motbf.fit.node', or 'jointmotbf').

...

Further arguments to be passed as for plot.

xlim, ylim

Numeric vectors of length 2 specifying x and y axis limits. By default 0:1. Used in 'univmotbf' and 'piecewisemop'.

type

Character string specifying the plot type, as for plot. For 'univmotbf' defaults to 'l' (line); for 'jointmotbf' defaults to "contour" (another option is "perspective").

add

Logical; if TRUE, adds the plot to the existing active graphics device. Used only in 'univmotbf'.

panels

Logical; if TRUE, displays plots in separate panels. Used only in 'motbf.fit.node'.

ranges

A "numeric" matrix containing the domain of the variables, by columns, which is used to specify the plotting range. Used only in 'jointmotbf'.

orientation

A "numeric" vector indicating the perpective of the plot in degrees. By default, it is set to (5,-30). Used only in 'jointmotbf'.

data

An object of class "data.frame" containing two columns only. This argument is used to draw the points over the main plot. By default, it is set to NULL. Used only in 'jointmotbf'.

filled

A logical argument; it is only used if type = "contour". is active. By default, it is TRUE, so filled contours are plotted. Used only in 'jointmotbf'.

ticktype

A "character" string, either simple or detailed. By default, it is set to "simple", which draws just an arrow parallel to the axis to indicate direction of increase. In contrast, "detailed" draws normal ticks. This argument is only used in the "perspective" plot. Used only in 'jointmotbf'.

main

Title string for the plot. Used in 'jointmotbf'.

Value

A plot of the specificated function.

Examples


## 1. univmotbf - Example for univariate distributions 
## Data
X <- rexp(2000)

f1 <- univMoTBF(X, POTENTIAL_TYPE = "MOP")
f2 <- univMoTBF(X, POTENTIAL_TYPE = "MTE", maxParam = 10)

## Plots
plot(NULL, xlim = range(X), ylim = c(0,0.8), xlab="X", ylab="density")
plot(f1, xlim = range(X), col = 1, add = TRUE)
plot(f2, xlim = range(X), col = 2, add = TRUE)


## 2. jointmotbf - Example for join distributions 
## Data
X <- data.frame(rnorm(500), rnorm(500))

## Joint function
dim <- c(3,3) 
P <- jointmotbf.fit(X, dimensions = dim)

## Plots
plot(P)
plot(P, type = "perspective", orientation = c(90,0))


MoTBFs documentation built on Oct. 6, 2026, 1:06 a.m.