How do you center a title for a diagram output to SVG using dot?

Graphviz

Graphviz Problem Overview


So far I tried this line but dot keeps pushing it aside making room for my nodes (pushes it to the right):

_diagram_info [shape="plaintext", label="My Diagram\l", fontsize=13]

Is there a way to center the label by pos, using dot?

Graphviz Solutions


Solution 1 - Graphviz

That's how I'd add a title for a graph:

digraph {
    // nodes, edges, subgraphs 
    ...
    // title
    labelloc="t";
    label="My Diagram";
}

This will add a centered title to the top of the graph.

The same syntax can also be used for subgraphs.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionchtrinhView Question on Stackoverflow
Solution 1 - GraphvizmarapetView Answer on Stackoverflow