Skip to content

Bug with node.text for certain plotting.direction #179

@whelena

Description

@whelena

When plotting direction is set to up, left, right or any angle outside +- 90 degrees, code fails to render texts with this error:

Error in strwidth(node.text, units = "inches", cex = cex) : 
  invalid 'cex' value

e.g.

small.phy <- data.frame(
    node.id = c('1', '2', '3'),
    parent = c(NA, '1', '1'),
    length.1 = 5
    );

text.dt <- data.frame(
    node = c('1','1', '2', '3'),
    name = c('CNA', 'hello', '12', 'bird'),
    col = c('red', 'blue', 'green', 'purple'),
    fontface = c('bold', 'italic', NA, 'bold')
    );

create.phylogenetic.tree(
            small.phy,
            node.text = text.dt,
            plotting.direction = 45,
            add.normal = TRUE
            );
Image

Error example:
Image

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions