imageboxplot {patternplot}R Documentation

Plot a boxplot with boxes filled with png and jpeg images.

Description

The imageboxplot function is a tool for creating versatile boxplots by filling the boxplots with external png and jpeg images.

Usage

imageboxplot(
  data,
  x,
  y,
  group = NULL,
  xlab = "",
  ylab = "",
  label.size = 3.5,
  pattern.type,
  frame.color = "black",
  linetype = "solid",
  frame.size = 1,
  outlier.shape = 21,
  outlier.color = "black",
  outlier.size = 1,
  legend.type = "h",
  legend.h = 6,
  legend.x.pos = 1.1,
  legend.y.pos = 0.49,
  legend.w = 0.2,
  legend.pixel = 0.3,
  legend.label
)

Arguments

data

the data to be used.

x

the variable used on x axis.

y

the variable used on y axis.

group

the variable used as the second grouping variable on x axis.

xlab

a character string to give x axis label.

ylab

a character string to give y axis label.

label.size

the font size of legend labels.

pattern.type

a list of objects returned by readPNG and readJPEG used to fill boxplots.

frame.color

the color for the borders of boxplots.

linetype

the linetype for the borders of boxplots.

frame.size

a numeric value, the line size for the borders of boxplots.

outlier.shape

the shape of outlier dots.

outlier.color

the color of outlier dots.

outlier.size

the size of outlier dots.

legend.type

if legend.type='h', the layout of legends is horizontal; if legend.type='v', the layout of legends is vertical.

legend.h

a numeric value to fine-tune the width of legend boxes on y axis.

legend.x.pos

a numeric value to change the position of legend text on x axis.

legend.y.pos

a numeric value to change the position of legend text on y axis.

legend.w

a numeric value to change the width of legends.

legend.pixel

a numeric value to change the pixel of legend boxes.

legend.label

a vector to name legend labels.

Details

imageboxplot function offers flexible ways of doing boxplots.

Value

A ggplot object.

Author(s)

Chunqiao Luo (chunqiaoluo@gmail.com)

See Also

Function patternboxplot

Examples

library(patternplot)
library(jpeg)
library(ggplot2)

Orange<-readJPEG(system.file("img", "oranges.jpg", package="patternplot"))
Strawberry <-readJPEG(system.file("img", "strawberries.jpg", package="patternplot"))
Watermelon<-readJPEG(system.file("img", "watermelons.jpg", package="patternplot"))

#Example 1
data <- read.csv(system.file("extdata", "fruits.csv", package="patternplot"))
x<-data$Fruit
y<-data$Weight
group<-data$Store
pattern.type<-list(Orange, Strawberry, Watermelon)
imageboxplot(data,x,y,group=NULL,pattern.type=pattern.type,
frame.color=c('orange', 'darkred', 'darkgreen'),
legend.label="", ylab='Weight, Pounds')

[Package patternplot version 1.0.0 Index]