473,320 Members | 1,900 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

prog/lib to draw graphs

Hello,
I'm looking for a program or python library to draw graphs.
They should look like the that:
/--------\ /--------\
| Node A | ------ belongs to ----> | Node B |
\--------/ \--------/

Which is a result of the function call like that:

connectNodes(firstNode, secondNode, description, lineStyle)
connectNodes("Node A", "Node B", "belongs to", dashed)

It should have a open scalable vector format as output (DVI, SVG, PDF, ...)
and should be able to make automatic optimal placement of the items.
Do you know something like that?
Thx,
Florian
Jul 18 '05 #1
7 2341
Florian Lindner wrote:
Hello,
I'm looking for a program or python library to draw graphs.
They should look like the that:
/--------\ /--------\
| Node A | ------ belongs to ----> | Node B |
\--------/ \--------/

Which is a result of the function call like that:

connectNodes(firstNode, secondNode, description, lineStyle)
connectNodes("Node A", "Node B", "belongs to", dashed)

It should have a open scalable vector format as output (DVI, SVG, PDF, ...)
and should be able to make automatic optimal placement of the items.
Do you know something like that?
Thx,
Florian


Try graphviz:

http://www.research.att.com/sw/tools/graphviz/
I think there's a python interface to graphviz floating around (Google
it), but it's trivial to write a Python routine that spits out valid
Graphviz "dot" files.

In the case of your example, the contents of the dot file would be
something like:

digraph G{
"Node A" -> "Node B" [label="belongs to"];
}
--Paul
Jul 18 '05 #2
>>>>> "Florian" == Florian Lindner <Fl*************@xgm.de> writes:

Florian> Hello, I'm looking for a program or python library to
Florian> draw graphs. They should look like the that:
Florian> /--------\ /--------\ | Node A | ------ belongs to ---->
Florian> | Node B | \--------/ \--------/

Florian> Which is a result of the function call like that:

Florian> connectNodes(firstNode, secondNode, description,
Florian> lineStyle) connectNodes("Node A", "Node B", "belongs to",
Florian> dashed)

Florian> It should have a open scalable vector format as output
Florian> (DVI, SVG, PDF, ...) and should be able to make
Florian> automatic optimal placement of the items. Do you know
Florian> something like that? Thx, Florian --
Florian> http://mail.python.org/mailman/listinfo/python-list

graphviz is a sophisticated graph drawing program

http://www.research.att.com/sw/tools/graphviz/

There is a python interface

http://www.cs.virginia.edu/~jg9h/graphiz/

JDH
Jul 18 '05 #3
[P&M]

Florian Lindner wrote:
Hello,
I'm looking for a program or python library to draw graphs.
They should look like the that:
/--------\ /--------\
| Node A | ------ belongs to ----> | Node B |
\--------/ \--------/

Florian -

Graphviz (http://www.graphviz.org) is a great package for drawing
graphs. It ouputs to many formats. There is a python lib for it at
http://www.freshports.org/graphics/py-graphviz/, but I have not used
it. It's easy enough to generate dot[1] code and call dot to generate
the graph image, so that's what I usually do.

HTH,

Bill
1. 'dot' is one of the graphviz commands.
Which is a result of the function call like that:

connectNodes(firstNode, secondNode, description, lineStyle)
connectNodes("Node A", "Node B", "belongs to", dashed)

It should have a open scalable vector format as output (DVI, SVG, PDF, ...)
and should be able to make automatic optimal placement of the items.
Do you know something like that?
Thx,
Florian

Jul 18 '05 #4
netnews.upenn.edu wrote:
Florian Lindner wrote:
Hello,
I'm looking for a program or python library to draw graphs.
They should look like the that:
/--------\ /--------\
| Node A | ------ belongs to ----> | Node B |
\--------/ \--------/

Which is a result of the function call like that:

connectNodes(firstNode, secondNode, description, lineStyle)
connectNodes("Node A", "Node B", "belongs to", dashed)

It should have a open scalable vector format as output (DVI, SVG, PDF,
...) and should be able to make automatic optimal placement of the items.
Do you know something like that?
Thx,
Florian


Try graphviz:

http://www.research.att.com/sw/tools/graphviz/
I think there's a python interface to graphviz floating around (Google
it), but it's trivial to write a Python routine that spits out valid
Graphviz "dot" files.

In the case of your example, the contents of the dot file would be
something like:

digraph G{
"Node A" -> "Node B" [label="belongs to"];
}


Thanks! (to all)
Does GraphViz also support the automated optimal placement of nodes? I'll
have many nodes...
Thx,
Florian
Jul 18 '05 #5
graphivz seems good but it is an external tool... Is there something
similar as http://gef.tigris.org for python ?

Yermat

Jul 18 '05 #6

On Jan 22, 2004, at 5:15 AM, Florian Lindner wrote:
Thanks! (to all)
Does GraphViz also support the automated optimal placement of nodes?
I'll
have many nodes...


What constitutes optimal is a matter of an entire subfield of graph
theory, and is pretty different depending on what type of graph you are
doing. Nonetheless, graphviz does pretty well without any cues. In a
project I used to use it in (a browser for large automatically learned
ontologies) I would sometimes use it to render thousands of nodes, and
it would usually look better than I expected. There is a problem in
that highly connected large graphs result in a lot of black ink for the
edges, since in such graph they will be much denser than the DPI of
your screen. I'm not sure you'll find any full display of a large
graph practical for interactive use without a lot of tweaking.

If you do want to use it interactively, be prepared for long waits
(>30s, sometimes several minutes) for very large graphs. For small
graphs, it's near instantaneous. This is a problem with graph layout
algorithms in general, however, and not graphviz per se - they do not
scale very efficiently. People I know who used ygraph, a commercial
package, told me that it was not much faster on large graphs.

hope that helps,
-kyle
Jul 18 '05 #7
Florian Lindner <Fl*************@xgm.de> wrote in message news:<bu*************@news.t-online.com>...
Hello,
I'm looking for a program or python library to draw graphs.
They should look like the that:
/--------\ /--------\
| Node A | ------ belongs to ----> | Node B |
\--------/ \--------/

Which is a result of the function call like that:

connectNodes(firstNode, secondNode, description, lineStyle)
connectNodes("Node A", "Node B", "belongs to", dashed)

It should have a open scalable vector format as output (DVI, SVG, PDF, ...)
and should be able to make automatic optimal placement of the items.


Since you mention DVI you probably know about LaTeX. You might
want to try its `psfrag' package, which can do all you want and
more. Learning curve is a bit steep, but the results are _very_
high quality. Nothing to do with Python though......
Jul 18 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Mark Fenbers | last post by:
I am investigating Python for the sake of ultimately generating hydrographs (such as this: http://ahps.erh.noaa.gov/iln/ahps/RiverDat/gifs/prgo1.png) on-the-fly from a web server cluster. I have...
9
by: rhmd | last post by:
I need to create image files (eg bmp or jpeg) of xy scatter graphs (i.e., graphs in which markers denote individual points; the markers need to be small polygons of various sizes, shapes, colors,...
22
by: MJR | last post by:
Hi, just wondering what options I would have if I wanted to use Python to produce real-time graphs. Is there any plotting package suitable for this. Thanks, Mike
6
by: gong | last post by:
hi i recently looked at alexandrescu's book on c++, and i found it pretty much unintelligible. i have a few points which i wonder about. 1. as a developer, it is important, from a bottom line...
16
by: David Lauberts | last post by:
Hi Wonder if someone has some words of wisdom. I have a access 2002 form that contains 2 graph objects that overlay each other and would like to export them as a JPEG to use in a presentation....
0
by: Ray Mitchell | last post by:
Hello, I need to write an application that displays multiple graphs on multiple tabbed sheets in a single window. The graphs are all simple X-Y line graphs like you'd see on an oscilloscope,...
0
by: Bruce Schechter | last post by:
I need to generate a series of line charts dynamically from ADO.NET data in an ASP.NET application. I've read several articles about using GDI+ to render graphs into a bitmap image and then to...
4
by: Giandomenico Sica | last post by:
Call for Cooperation An Atlas of Linguistic Graphs I'm a researcher in graph theory and networks. I'm working about a project connected with the theory and the applications of linguistic...
18
by: raghunadhs | last post by:
Hi All, I have few pairs of float vlues, like (1.5,4.5),(4.67,8.90)..etc. Now i want to draw a graph among the points. is there any "Graph" control? is it possible to draw graphs...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.