addLegend: Add graph legends to RedeR application.

Description Usage Arguments Details Value Author(s) Examples

Description

Methods to send legends to RedeR app.

Usage

1
2
3
addLegend.color(obj, colvec,  ...)
addLegend.size(obj, sizevec, ...)
addLegend.shape(obj, shapevec, ...)

Arguments

obj

Object of RedPort Class.

colvec

Vector with legend colors, either hexadecimal or valid R color names.

sizevec

Vector with legend node size, options: > 0 <numeric>.

shapevec

Vector with valid shape names: 'ELLIPSE', 'RECTANGLE', 'ROUNDED_RECTANGLE', 'TRIANGLE', 'DIAMOND'.

...

Additional arguments passed to RedeR application.

Details

Alternatively, colvec, sizevec and shapevec can be igraph objects with legend information previously set by the functions 'att.setv' and 'att.sete'.

Additional arguments:

type

Legend type. Options: "node" or "edge" (default: "node") <character>.

labvec

Vector with legend labels <character>.

position

Position of the legend in RedeR panel. Options: 'topleft','topright','bottomleft','bottomright' (default: addLegend.color "topright", addLegend.size "bottomleft", and addLegend.shape "bottomright" )<character>.

dxborder

Distance (in pixel) from panel border (default: 5 ) <numeric>.

dyborder

Distance (in pixel) from panel border (default: 5 ) <numeric>.

vertical

Logical value, set vertical/horizontal position of the legend in the app panel (default: TRUE for addLegend.color and addLegend.size and FALSE for addLegend.shape.

ftsize

Font size (in pixel) (default: 8) <numeric>.

title

Legend title <string>.

dxtitle

Distance (in pixel) from legend title to the main axis (default: 35) <numeric>.

size

Legend size; only for addLegend.color and addLegend.shape methods (default: 30) <numeric>.

bend

Legend width/height ratio; only for addLegend.color method (default: 0.85) <numeric>.

col

Legend color; only for addLegend.size and addLegend.shape methods (default: "#000000") <either hexadecimal or valid color name>.

intersp

Legend inter space (only for addLegend.size and addLegend.shape methods) (default: 0) <numeric>.

edgelen

Length of the edges in addLegend.size method (default: 50) <numeric>.

Value

Send legend objects to RedeR app.

Author(s)

Mauro Castro

Examples

 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
# Initialize igraph
library(igraph)

## Not run: 

rdp <- RedPort()
calld(rdp)

cols<-colorRampPalette(colors=c('red','blue'))(14)	
addLegend.color(rdp,cols)
addLegend.color(rdp,cols,type="edge")

size<-c(10,20,30,40,50)
addLegend.size(rdp,size)

size<-c(1:10)
addLegend.size(rdp,size,type="edge")

shape<-c('ELLIPSE', 'RECTANGLE', 'ROUNDED_RECTANGLE', 'TRIANGLE', 'DIAMOND')
addLegend.shape(rdp,shape)

shape<-c('SOLID','DOTTED','DOTTED_SHORT','LONG_DASH')
addLegend.shape(rdp,shape,type="edge")

## End(Not run)

RedeR documentation built on Nov. 8, 2020, 7:45 p.m.