plot {sets}R Documentation

Plot functions for generalized sets

Description

Plot and lines functions for (tuples of) generalized sets and function generators of characteristic functions.

Usage

## S3 method for class 'gset'
plot(x, type = NULL, ylim = NULL,
         xlab = "Universe", ylab = "Membership Grade", ...)
## S3 method for class 'cset'
plot(x, ...)
## S3 method for class 'set'
plot(x, ...)
## S3 method for class 'tuple'
plot(x, type = "l", ylim = NULL,
         xlab = "Universe", ylab = "Membership Grade", col = 1,
         continuous = TRUE, ...)
## S3 method for class 'charfun_generator'
plot(x, universe = NULL, ...)

## S3 method for class 'gset'
lines(x, type = "l", col = 1, continuous = TRUE,
         universe = NULL, ...)
## S3 method for class 'cset'
lines(x, ...)
## S3 method for class 'set'
lines(x, ...)
## S3 method for class 'tuple'
lines(x, col = 1, universe = NULL, ...)
## S3 method for class 'charfun_generator'
lines(x, universe = NULL, ...)

Arguments

x

For a method for class foo, an object of class foo.

type

Same as the type argument of plot. For plot.gset and plot.cset, "barplot" can also be used.

universe

Universal set used for setting up the plot region. By default, this is deduced from the object(s) to be plotted.

col

Character or integer vector specifying the color of the object(s) to be plotted.

continuous

Logical indicating whether zero membership degrees “inside” the graph should be ignored.

xlab, ylab

Character labels for the axes.

ylim

Double vector of length 2 defining the range of the y axis.

...

Further arguments passed to the default plot methods.

Value

The main argument (invisibly).

See Also

set, gset, and tuple for the set types, and fuzzy_normal for available characteristic functions.

Examples

## basic plots
plot(gset(1:3, 1:3/3))
plot(gset(1:3, 1:3/3, universe = 0:4))
plot(gset(c("a", "b"), list(1:2/2, 0.3)))

## characteristic functions
plot(fuzzy_normal)
plot(tuple(fuzzy_normal, fuzzy_bell), col = 1:2)
plot(fuzzy_pi3_gset(min = 2, max = 15))

## superposing plots using lines()
x <- fuzzy_normal_gset()
y <- fuzzy_trapezoid_gset(corners = c(5, 10, 15, 17), height = c(0.7, 1))
plot(tuple(x, y))
lines(x | y, col = 2)
lines(x & y, col = 3)

## another example using gset_mean
x <- fuzzy_two_normals_gset(sd = c(2, 1))
y <- fuzzy_trapezoid_gset(corners = c(5, 9, 11, 15))
plot(tuple(x, y))
lines(tuple(gset_mean(x, y),
            gset_mean(x, y, "geometric"),
            gset_mean(x, y, "harmonic")),
      col = 2:4)

## creating a sequence of sets
plot(fuzzy_tuple(fuzzy_cone, 10), col = gray.colors(10))

[Package sets version 1.0-25 Index]