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

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/imageboxplot.R

Description

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

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
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')

Example output



patternplot documentation built on April 21, 2020, 5:05 p.m.