Learn R Programming

RedeR (version 1.20.0)

addLegend: Add graph legends to RedeR application.

Description

Methods to send legends to RedeR app.

Usage

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 .
shapevec
Vector with valid shape names: 'ELLIPSE', 'RECTANGLE', 'ROUNDED_RECTANGLE', 'TRIANGLE', 'DIAMOND'.
...
Additional arguments passed to RedeR application.

Value

Send legend objects to RedeR app.

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") .

labvec
Vector with legend labels .

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

dxborder
Distance (in pixel) from panel border (default: 5 ) .

dyborder
Distance (in pixel) from panel border (default: 5 ) .

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) .

title
Legend title .

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

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

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

col
Legend color; only for addLegend.size and addLegend.shape methods (default: "#000000") .

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

edgelen
Length of the edges in addLegend.size method (default: 50) .

See Also

addGraph att.setv att.sete

Examples

Run this code

rdp <- RedPort('MyPort')

## Not run: 
# 
# 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)

Run the code above in your browser using DataLab