Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Python ASCII Graph Drawing [closed]

I'm looking for a library to draw ASCII graphs (for use in a console) with Python. The graph is quite simple: it's only a flow chart for pipelines.

I saw NetworkX and igraph, but didn't see a way to output to ascii.

Do you have experience in this?

Thanks a lot!

Patrick

EDIT 1: I actually found a library doing what I need, but it's in perl Graph::Easy . I could call the code from python but I don't like the idea too much... still looking for a python solution :)

like image 851
Patrick Avatar asked May 07 '09 12:05

Patrick


2 Answers

ascii-plotter might do what you want...

like image 51
David Wolever Avatar answered Sep 25 '22 03:09

David Wolever


When you say 'simple network graph in ascii', do you mean something like this?

.===.   .===.   .===.   .===. | a |---| b |---| c |---| d | '==='   '==='   '---'   '===' 

I suspect there are probably better ways to display whatever information it is that you have than to try and draw it on the console. If it's just a pipeline, why not just print out:

a-b-c-d 

If you're sure this is the route, one thing you could try would be to generate a decent graph using Matplotlib and then post the contents to one of the many image-to-ascii converters you can find on the web.

like image 43
Jon Cage Avatar answered Sep 24 '22 03:09

Jon Cage