faq-output

FaqDottySyntaxError

 

Why does dotty report a syntax error on a legal dot file?

Typically this error is reported as:

  • >> graph parser: syntax error near line 14
    >> context: >>> <<< digraph G {
    >> dotty.lefty: giving up on dot
    >> dotty.lefty: graph that causes dot
    >> dotty.lefty: to fail has been saved in file dottybug.dot

FaqDottyNumlock

 

Sometimes in dotty, right mouse click shows the global menu but none of the items can be selected.

Check that the NUMLOCK key is off. It's a known bug.

GraphvizWiki: FaqDottyNumlock (last edited 2008-01-17 18:07:35 by H-135-207-131-158)

FaqCustomShape

 

How can I get custom shapes or images in my graph?

Please see the Shape HowTo for some approaches. There is no easy way to create custom shapes that work with dot/neato, dotty (Unix or MS-Windows) and Grappa (the Java front end), because they don't share any universal back end structure. We're thinking about it.

FaqJpgArtifacts

 

When I have a red edge it shows up as a solid red in PNG and GIF formats, but has a black border when rendered to JPEG.

This is an artifact of JPEG's lossy compression algorithm. JPEG isn't very good for line drawings. PNG is bitmap format of choice. John Ellson wants to deprecate and eventually remove the JPEG driver, but North is reluctant to change anything that people might already rely on.

FaqMultiPage

 

How can I print a big graph on multiple pages?

The page attribute, if set, tells Graphviz to print the graph as an array of pages of the given size. Thus, the graph

FaqRecordLR

 

Record nodes are drawn differently in dot and neato when rankdir=LR.

FaqPlainArrows

 

In -Tplain format, splines do not touch the nodes (arrowheads are missing).

Edges are specified as the main spline and, if necessary, arrowheads which actually abut the node. If the arrowheads are not given, drawing the edge spline will leave a gap between the edge and the node. This is a bug which has now solidified into a feature. A workaround is to set

  • edge [dir=none]

Since the edges have no arrowheads, the spline specification will go all the way to both nodes.

FaqFontChanges

 

How do I get font and color changes in record labels or other labels?

This is not possible in record shapes. However, you can do this using HTML-like labels. The granularity of changes is still at the cell level, but by playing with cell spacing and padding, you can get pretty much the effect you want. The intention is to support arbitrary font changes within running text in the not-too-distant future.

FaqNonAscii

 

More generally, how do I use non-ASCII character sets?

The following applies to Graphviz 2.8 and later. (In older versions of Graphviz, you can sometimes get away with simply putting Latin-1 or other UTF-8 characters in the input stream, but the results are not always correct.)

Input: the general idea is to find the Unicode value for the glyph you want, and enter it within a text string "...." or HTML-like label <...>.

FaqSymbols

 

How do I create special symbols and accents in labels?

The following solution only works with the raster drivers that load Truetype or Type1 fonts! (That means, -Tgif, -Tpng, -Tjpeg, and possibly -Tbmp or -Txbm if enabled). Use UTF8 coding, e.g. &#165; for the Yen currency symbol ¥. Example:

  • graph G {
    • yen [label="&#165;"]

Syndicate content