0

How can I load two separate dot.files in python. I was trying like this but I got an error.

#import pygraphviz as pgv
import networkx as nx   
#import matplotlib.pyplot as plt
Gtmp1 = nx.read_dot("case1.dot")
Gtmp2 = nx.read_dot("case2.dot")

Error:

Warning: syntax error in line 2 near '"'
Traceback (most recent call last):
  File "/home/thinkpad/anaconda3/lib/python3.4/site-packages/pygraphviz/agraph.py", line 1201, in read
    self.handle = gv.agread(fh, None)
ValueError: agread: bad input data

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "Graphs.py", line 196, in <module>
    Gtmp2 = nx.read_dot("case2.dot")
File "/home/thinkpad/anaconda3/lib/python3.4/site-packages/networkx/drawing/nx_agraph.py", line 197, in read_dot
    A=pygraphviz.AGraph(file=path)
  File "/home/thinkpad/anaconda3/lib/python3.4/site-packages/pygraphviz/agraph.py", line 162, in __init__
self.read(filename)
  File "/home/thinkpad/anaconda3/lib/python3.4/site-packages/pygraphviz /agraph.py", line 1203, in read
raise DotError
pygraphviz.agraph.DotError

0 Answers0