align problem in record

how can I align all lines with the left side of the record node?

this is a simple example of my problem

and this is a my simple code
n2 [label = "this is line1\ncan I align with the left side\nline3"];

I want to align all lines with the left side,and
I try to use 'nojustify = "true"' or 'labeljust = "l"',
but I can't solve it.

how can I do?

by the way,when I output a picture to .svg format ,the text will exceed the bound of node.
and when I change to .png format ,this problem is not exist.

like this:
png :
svg :


align problem in record

Use \l instead of \n; see
labeljust only applies to cluster labels; nojustify is only useful in the context of records.

First, make sure you are using a fairly recent version of Graphviz. Older versions had some problems with svg. That said, the svg standard is very lax as to what it requires from svg viewers in terms of fonts. Graphviz makes its font calculations based on the fonts at hand, but the svg viewer may use totally different fonts that have significant size differences. The only way to guarantee a correct layout is for the svg output to contain the font glyphs used during layout. You can get this by using -Tsvg:cairo.

problem has been solved

thank you very much!
I followed your solution,and then the two problems was solved!
thank you for your help!

Recent comments