# Importing a .dot graph file, and changing vertex label format

I worked out how (one way...) to import a .dot graph format file into Mathematica using

Import["/home/username/Desktop/mygraph.dot"]


which works a treat, drawing a nice graph with vertices and edges all joined up.

But can anyone please explain how I can make the vertex labels either bigger, or add a coloured background to the label text?

I have many edges between vertices and as it is the thin black small text is difficult to read.

Thanks

You can add Graphoptions during Importing. That is, if example.dot is the file to be imported

Export["example.dot", Import["ExampleData/sample.gv"], "DOT"]


"example.dot"

you can import it as follows

Import["example.dot", ImagePadding -> 20, ImageSize -> 400,
VertexLabelStyle -> 16, EdgeStyle -> Directive[Red, Thick]]


to get

This feature is documented in DOT >> Options:

Alternatively, if you already imported the graph, you can use SetProperty to make changes in any of the Graph options:

g2 = Import["example.dot"]


SetProperty[g2, {VertexLabelStyle -> 16, EdgeStyle -> Directive[Red, Thick],
ImageSize -> 400, ImagePadding -> 30}]