Skip to content

Feature request: rotatable vertex labels #106

@BrianDiggs

Description

@BrianDiggs

I would like to request a new feature: the ability to rotate (set the text angle of) the vertex labels that are printed. My motivation for this was creating a graph with the sugiyama layout. I have long names for my vertices, and with them arranged along horizontal lines, the labels were overlapping to the point of being unreadable.

As a brute force proof-of-concept, I edited a local copy of plot.igraph and added a srt argument to text at https://github.com/igraph/rigraph/blob/dev/R/plot.R#L394. All the labels were printed at my (fixed, constant) specified angle. A proper implementation would allow the angle to be set as a vertex parameter (vertex.label.angle, perhaps? A consideration as to if it should be in degrees (as srt expects) or radians (to be consistent with vertex.label.degree) is needed). There are other text calls in the "add the labels" section of plot.igraph that would need to be changed, and I did not even look at whether this was possible with tkplot or rglplot

In addition to helping with long labels with the sugiyama layout, I imagine it could be helpful for grid layouts too.

Metadata

Metadata

Assignees

Labels

plotting 💹Issues related to plottingwishlistFeature request that has not been chosen for implementation yet; vote or comment to prioritize it!

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions