Learn R Programming

FuzzySpec (version 1.0.0)

plot.fuzzy: Plot 2D Fuzzy Data with Optional Uncertainty Sizing and Cluster Colouring

Description

Creates a ggplot of 2D points with optional colouring by hard labels and optional observation-size mapping to fuzzy uncertainty.

Usage

# S3 method for fuzzy
plot(x, plotFuzzy = TRUE, colorCluster = TRUE, ...)

Value

A ggplot object.

Arguments

x

A list as returned by gen.fuzzy, containing X, U, y, and k.

plotFuzzy

Logical; if TRUE, map observation size to uncertainty \(1-\max_j U_{ij}\).

colorCluster

Logical; if TRUE, colour points by the hard cluster label y.

...

Additional arguments (currently unused).

Details

The plotting aesthetics can be modified as follows:

  • If plotFuzzy and colorCluster are both TRUE (default), the plot contains cluster coloured observations that are size scaled by uncertainty.

  • If only plotFuzzy is TRUE, the plot contains monochrome coloured observations that are size scaled by uncertainty.

  • If only colorCluster is TRUE, the plot contains cluster coloured observations with fixed size.

  • If plotFuzzy and colorCluster are both FALSE, the plot is monochrome coloured observations with fixed size.

References

H. Wickham (2016). ggplot2: Elegant Graphics for Data Analysis. Springer--Verlag New York.

See Also

gen.fuzzy, ggplot

Examples

Run this code
set.seed(1)
d1 <- gen.fuzzy(n = 600, dataset = "gaussian", seed = 1)
p1 <- plot.fuzzy(d1)
p1 # default

p2 <- plot.fuzzy(d1, plotFuzzy = TRUE, colorCluster = FALSE)
p2 # only uncertainty sizing, monochrome

p3 <- plot.fuzzy(d1, plotFuzzy = FALSE, colorCluster = TRUE)
p3 # only coloured by cluster, no uncertainty sizing

Run the code above in your browser using DataLab