-
-
Notifications
You must be signed in to change notification settings - Fork 205
Feature request: rotatable vertex labels #106
Copy link
Copy link
Closed
Labels
plotting 💹Issues related to plottingIssues related to plottingwishlistFeature request that has not been chosen for implementation yet; vote or comment to prioritize it!Feature request that has not been chosen for implementation yet; vote or comment to prioritize it!
Milestone
Metadata
Metadata
Assignees
Labels
plotting 💹Issues related to plottingIssues related to plottingwishlistFeature request that has not been chosen for implementation yet; vote or comment to prioritize it!Feature request that has not been chosen for implementation yet; vote or comment to prioritize it!
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.igraphand added asrtargument totextat 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 (assrtexpects) or radians (to be consistent withvertex.label.degree) is needed). There are othertextcalls in the "add the labels" section ofplot.igraphthat would need to be changed, and I did not even look at whether this was possible withtkplotorrglplotIn addition to helping with long labels with the sugiyama layout, I imagine it could be helpful for grid layouts too.