Learn R Programming

trackr (version 0.10.7)

hasLegend: Accessor method for the legend indicator (slot "haslegend") of the plot object.

Description

Get whether or not a plot or PlotFeatureSet.

Usage

hasLegend(object)

# S4 method for PlotFeatureSet hasLegend(object)

# S4 method for ggplot hasLegend(object)

# S4 method for trellis hasLegend(object)

# S4 method for gTree hasLegend(object)

# S4 method for PlotFeatureSet hasLegend(object)

Arguments

object

An object of class PlotFeatureSet, GGplotFeatureSet, TrellisFeatureSet, ggplot, or trellis.

Value

A boolean indicating whether or not a legend is displayed in the plot.

Examples

Run this code
# NOT RUN {
library(ggplot2)
mt = datasets::mtcars
plt = qplot(mt$mpg, mt$cyl)
fs = makeFeatureSet(plt)
hasLegend(fs)
# }

Run the code above in your browser using DataLab