p.col_ord_wl: Ordered bar plot with legend

Description Usage Arguments Value Examples

View source: R/pcolordwl.R

Description

p.col_ord_wl make a ordered bar plot with legend.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
p.col_ord_wl(
  data,
  xaxis,
  yaxis,
  ybreaks = 10,
  percent = FALSE,
  dec = FALSE,
  yaccuracy = 0.01,
  ydecimalmark = ".",
  title = "Title",
  xlab = "X axis",
  ylab = "Y axis",
  stitle = NULL,
  note = NULL,
  ctitles = "black",
  cscales = ctitles,
  cbgrid = "white",
  clgrid = cbgrid,
  cplot = "white",
  cbserie = "black",
  cticks = "black",
  lwdserie = 1,
  legtitle = "Legend",
  legsize = 8,
  cleg = ctitles,
  legheight = 0.5,
  pnote = 1,
  cbord = cplot,
  titlesize = 20,
  wordssize = 12,
  snote = 11,
  legpos = "right",
  legdir = "horizontal",
  legcol = "white",
  legspa = 1,
  legvjust = 0.5,
  colors = grDevices::rainbow(length(xaxis), v = 0.7)
)

Arguments

data

a dataframe

xaxis

x axis data

yaxis

y axis data

ybreaks

number of y axis breaks (default=10)

percent

If TRUE y axis in percent (default=F)

dec

If TRUE serie come be decrescent,if FALSE crescent(default=F)

yaccuracy

a round for y axis (default=0.01)

ydecimalmark

y decimal mark (default=".")

title

title of plot

xlab

x axis label

ylab

y axis label

stitle

subtitle

note

note

ctitles

color of titles (title,xlab,ylab)

cscales

color of the scales (default= same ctitles)

cbgrid

color of grid background

clgrid

color of grid lines

cplot

color of plot background

cbserie

color of serie border (default= same cserie)

cticks

color of axis ticks

lwdserie

size of serie

legtitle

title of legend box

legsize

size of legend

cleg

color of legend words

legheight

height of legend box

pnote

position of note (default=1) (only numbers)

cbord

color of plot border (default= same cplot)

titlesize

size of title (default=20) (only numbers)

wordssize

size of words (default=12) (only numbers)

snote

size of note (default=11) (only numbers)

legpos

legend position

legdir

legend direction

legcol

color of legend box

legspa

spacement in legend box

legvjust

vertical adjust in legend box

colors

colors of bars, need same number of correspondencies.

Value

Return ordered bar plot with legend.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
v=data.frame("x"=1:5,"y"=c(10,4,8,5,2))
p.col_ord_wl(v,xaxis= v$x,yaxis=v$y)
#or
p.col_ord_wl(v,xaxis= v[[1]],yaxis=v[[2]])

p.col_ord_wl(v,xaxis= v$x,yaxis=v$y,dec=TRUE,percent=FALSE)
p.col_ord_wl(v,xaxis= v$x,yaxis=v$y,dec=TRUE,percent=TRUE)
p.col_ord_wl(v,xaxis= v$x,yaxis=v$y,dec=FALSE,percent=FALSE)
p.col_ord_wl(v,xaxis= v$x,yaxis=v$y,dec=FALSE,percent=TRUE)

#Layout example
p.col_ord_wl(v,v$x,v$y,note = "metools - 2020",title = "Layout example",
stitle = "Ordered bar plot",ylab=NULL,wordssize = 10,titlesize = 32,
legspa = 0.5,legvjust = -2.5,legsize = 10,cplot='grey',
cbgrid="black",clgrid= "grey",ctitles = 'white',cleg = 'white',
legcol='black',colors=topo.colors(length(v$x),alpha=0.8))

metools documentation built on July 2, 2020, 2:28 a.m.