'Right-justify list in graphviz, python
I am unable to get a graphviz node label to be right justified when joining strings from a list. If I attach '\n' and '\r' to either end, the justification works, but it still shows the list elements (brakcets & quotes):
label_list = ['car','button','cloth']
label = ['\n' + s + '\r' for s in label_list]
If I use join, the right-justification is lost:
label_list = ['car','button','cloth']
label = ['\n' + s '\r' for s in label_list]
label = ''.join(label)
Per sroush comment, removing '\n' gives:
(or something similar to first example if join is not used).
What I'd like is simply:
Solution 1:[1]
Here is a Graphviz-only (no Python) solution:
graph j {
A [label="car\rbutton\rcloth\rmuch more\r"]
}
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | sroush |




