473,379 Members | 1,270 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,379 software developers and data experts.

How to create graphs an embed them in GUI?

Sorry for the fuzzy subject...

Currently I'm writing a little programm to extract some chemical
information out of a text file, and then present it in a pleasant way.
The Extraction works so far, so now the presentation will be next.

As I'm learning Python from scratch, I don't care wether to use (=learn)
TKinter or PyQt or whatever, I just need some advice, which suits my
needs best.
It would be nice to have the programm working under win and linux
(shouldn't be a big Problem) and my requirements concerning the standard
elements should be met by almost every framework.
My problem is, that I want to add graph (simple, line connected X,Y-
scatter plots) and if possible the 3D representation of atoms in a
molecule (-coloured spheres in space).
I think it would take me years to program those by myself, so I would ne
ready to use packages, if available.
Long story short: Are there packages that could do this, and does it
matter which GUI I want to embed them in?

best wishes
Jan 17 '08 #1
7 5554
On 2008-01-17, Heiko Niedermeyer <xe************************@gmx.dewrote:
As I'm learning Python from scratch, I don't care wether to use (=learn)
TKinter or PyQt or whatever, I just need some advice, which suits my
needs best.
It would be nice to have the programm working under win and linux
(shouldn't be a big Problem) and my requirements concerning the standard
PyGTK is a 3rd option, and wxWindows + Python is a 4th option.

TKinter is supplied with Python, which means everybody with Python also has
TKinter. Main draw-backs are that it is quite old. Also, it has a peculiar way
of getting stuff drawn at a canvas.

PyQt is available free with some additional restriction (plz read the
license) for the Linux system, I don't know whether you can also get a Win
version under the same conditions (you couldn't when I looked the last time).
PyGTK is said to be usable for both platforms. I know it works with Linux, and
there exists a PyGTK installer for Win, but I hacve never used it.

No recent experience with wxWindows.
My problem is, that I want to add graph (simple, line connected X,Y-
scatter plots) and if possible the 3D representation of atoms in a
molecule (-coloured spheres in space).
You should probably seperate both problems, in particular if you want to have
the program do the layout for you. For 2D layout, Graphviz is one of the better
known packages, run it as a child process. There are several graphviv/dot
Python libraries available, search PyPI for them.

For 3D, I don't know any programs.
I think it would take me years to program those by myself, so I would ne
ready to use packages, if available.
Long story short: Are there packages that could do this, and does it
matter which GUI I want to embed them in?
If you want a GUI that understands how to layout chemical structures, you won't
have many options (on the other hand, you never know, have you tried searching
PyPI already?).

On the other hand, once you have the coordinates, drawing them is kind of
trivial in just about any GUI toolkit.

(An alternative may be to have the user lay them out by dragging them with the
mouse. Programming that is however probably a lot more work.)
Sincerely,
Albert
Jan 17 '08 #2
Heiko Niedermeyer wrote:
Sorry for the fuzzy subject...

Currently I'm writing a little programm to extract some chemical
information out of a text file, and then present it in a pleasant way.
The Extraction works so far, so now the presentation will be next.

As I'm learning Python from scratch, I don't care wether to use (=learn)
TKinter or PyQt or whatever, I just need some advice, which suits my
needs best.
It would be nice to have the programm working under win and linux
(shouldn't be a big Problem) and my requirements concerning the standard
elements should be met by almost every framework.
My problem is, that I want to add graph (simple, line connected X,Y-
scatter plots) and if possible the 3D representation of atoms in a
molecule (-coloured spheres in space).
I think it would take me years to program those by myself, so I would ne
ready to use packages, if available.
Long story short: Are there packages that could do this, and does it
matter which GUI I want to embed them in?
I think "Vision" (formerly Viper)is exactly what you are looking for.
If not look at VTK.

cheers,
Stef
>
best wishes
Jan 17 '08 #3
Heiko Niedermeyer wrote:
Sorry for the fuzzy subject...

Currently I'm writing a little programm to extract some chemical
information out of a text file, and then present it in a pleasant way.
The Extraction works so far, so now the presentation will be next.

If the GUI is only for the graph, try matplotlib. It should do the
graphs/charts you require.

If necessary, you can combine matplotlib with another GUI toolkit for a
full GUI. This might be useful if you want to display menus and dialogs
to load the text files, etc.

3D is a different matter. I'd personally go with Python bindings for
VTK, but be warned that the learning curve is very steep and the online
docs are quite sparse (you're encouraged to buy the book, which is
probably the main source of income for the VTK devs).
Jan 17 '08 #4
Heiko Niedermeyer wrote:
Sorry for the fuzzy subject...

Currently I'm writing a little programm to extract some chemical
information out of a text file, and then present it in a pleasant way.
The Extraction works so far, so now the presentation will be next.

If the GUI is only for the graph, try matplotlib. It should do the
graphs/charts you require.

If necessary, you can combine matplotlib with another GUI toolkit for a
full GUI. This might be useful if you want to display menus and dialogs
to load the text files, etc.

3D is a different matter. I'd personally go with Python bindings for
VTK, but be warned that the learning curve is very steep and the online
docs are quite sparse (you're encouraged to buy the book, which is
probably the main source of income for the VTK devs).
Jan 17 '08 #5
On 17 Jan, 16:08, Heiko Niedermeyer <xena-die-
kriegerprinzes...@gmx.dewrote:
My problem is, that I want to add graph (simple, line connected X,Y-
scatter plots) and if possible the 3D representation of atoms in a
molecule (-coloured spheres in space).
I think it would take me years to program those by myself, so I would ne
ready to use packages, if available.
I would recommend using NumPy and SciPy together with Matplotlib.

For GUI, you can embed Matplotlib in e number of toolkits. wxPython,
PyGTK or PyQt are good options.

For 3D plots, there are e.g. an extension to Matplotlib (Mplot3D),
OpenGL, Direct3D (i.e. DirectPython), or VTK.
Sturla Molden


Jan 17 '08 #6
On Jan 17, 10:07 am, "A.T.Hofkamp" <h...@se-162.se.wtb.tue.nlwrote:
On 2008-01-17, Heiko Niedermeyer <xena-die-kriegerprinzes...@gmx.dewrote:
As I'm learning Python from scratch, I don't care wether to use (=learn)
TKinter or PyQt or whatever, I just need some advice, which suits my
needs best.
It would be nice to have the programm working under win and linux
(shouldn't be a big Problem) and my requirements concerning the standard

PyGTK is a 3rd option, and wxWindows + Python is a 4th option.

TKinter is supplied with Python, which means everybody with Python also has
TKinter. Main draw-backs are that it is quite old. Also, it has a peculiar way
of getting stuff drawn at a canvas.

PyQt is available free with some additional restriction (plz read the
license) for the Linux system, I don't know whether you can also get a Win
version under the same conditions (you couldn't when I looked the last time).
PyGTK is said to be usable for both platforms. I know it works with Linux, and
there exists a PyGTK installer for Win, but I hacve never used it.
PyQt 4+ is now available for MacOS, Windows, and X under GPL. I tried
Tkinter and wxPython before settling on PyQt. It's more powerful than
Tkinter and has a cleaner API than wxPython.
>
No recent experience with wxWindows.
My problem is, that I want to add graph (simple, line connected X,Y-
scatter plots) and if possible the 3D representation of atoms in a
molecule (-coloured spheres in space).
Qwt (Q Widgets for Technical Applications) provides graphs widgets
that plug into Qt. There are, of course, Python bindings (pyqwt).
>
You should probably seperate both problems, in particular if you want to have
the program do the layout for you. For 2D layout, Graphviz is one of the better
known packages, run it as a child process. There are several graphviv/dot
Python libraries available, search PyPI for them.

For 3D, I don't know any programs.
I think it would take me years to program those by myself, so I would ne
ready to use packages, if available.
Long story short: Are there packages that could do this, and does it
matter which GUI I want to embed them in?

If you want a GUI that understands how to layout chemical structures, you won't
have many options (on the other hand, you never know, have you tried searching
PyPI already?).

On the other hand, once you have the coordinates, drawing them is kind of
trivial in just about any GUI toolkit.

(An alternative may be to have the user lay them out by dragging them with the
mouse. Programming that is however probably a lot more work.)

Sincerely,
Albert
Jan 18 '08 #7
This is just a brief summary, how I'm trying to do it now. In case somone
ever encouters a problem like this...

For the 2D part, I'm going with matplotlib, which seems to do, what I want.
The 3D is currently donw be vpython, which is not great, but sufficient...
Maybe I will switch when I find something better... ;)

Thanks anyway.

Jan 25 '08 #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...
7
by: Florian Lindner | last post by:
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 |...
3
by: John Hunter | last post by:
matplotlib is a 2D plotting library for python. You can use matplotlib interactively from a python shell or IDE, or embed it in GUI applications (WX, GTK, and Tkinter). matplotlib supports many...
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
0
by: banderas | last post by:
Just wondering if it is possible to use access to create grpahs and even print reports? Is it possible to link excell with access so one can be the date base and when graphs and analytical reports...
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,...
8
by: phobos7 | last post by:
I am trying to create a single .EXE that will upgrade a product by the doing the following: 1) Detect the location of the current installation (DONE) 2) Upgrade the existing config file (DONE)...
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...
1
by: Tracy | last post by:
I am fairly new to the whole Javascript/ASP programming languages and I have run into a little snag. I am looking to have one web page create another, completely different, page. I have graphs that...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
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...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.