I am running Python and NetworkX (a graphing library) on Cygwin (Windows 7).
The following code creates a graph and attempts to draw it - but nothing appears on screen:
plt.ion()
nx.draw(nx.petersen_graph())
plt.show()
There don't appear to be any errors.
I have also tried saving a graph to an image using:
plt.savefig("test.png")
which creates the correct image.
Does this have to do with matplotlib and Cygwin?
I fixed this problem by:
startxwin
and running the script from there. backend = agg
setting to backend = tkagg
in my matplotlibrc file. Thanks to tcaswell
and EdChum
for the help.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.