addLegend {RedeR} | R Documentation

## 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 <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

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

[Package RedeR version 1.30.0 Index]