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

do me a favor?

Hi folks:

my sample data looks like following( tab-delimited):

Education Sex Experience Wage
10 1 5 10
5 1 10 9
15 0 10 15

Currently I am doing a project that will need Python/Tk as well as VTK(Visualization Toolkit) for image processing and visualization.

I want to plot one of variable in x-axes and one of variable in y-axes, and color by one of variables

I thought it may be a good idea to read data into python array (eg. each record into rows, attributes in columns) and then use a for loop to find the position of each points and color them.

Can anyone do me this big favour? give me some advices, thanks:-)
Sep 24 '06 #1
10 1739
bartonc
6,596 Expert 4TB
I don't know if VTK has plotting functions built in, so...
I haven't gotten into it yet, but I'm planning on using sciPy for my data plotting needs. Yes, you have to learn a new package, but you don't have to write plotting functions.
Sep 24 '06 #2
hi there:

I have another question about how to create a combo box (or listbox) in this project. can you help me please if you know :-)

Thanks
Sep 25 '06 #3
bartonc
6,596 Expert 4TB
Expand|Select|Wrap|Line Numbers
  1. import Tkinter as Tk
  2.  
  3. aList_of_data = [1,2,3,4]
  4.  
  5. if __name__ == "__main__":
  6.     root = Tk.Tk()
  7.     mainFrame = Tk.Frame(root)
  8.     mainFrame.pack()
  9.     lb = Tk.Listbox(mainFrame)
  10.     lb.config(bg="white")
  11.     lb.pack()
  12.  
  13.     lb.insert(0, *aList_of_data )
  14.  
  15.     root.mainloop()
  16.  
Sep 25 '06 #4
Thanks:-)

I thought there is no combo box in TK, is that right???

So I can only use list in my project.
Sep 25 '06 #5
bartonc
6,596 Expert 4TB
No combobox in tk is correct. I built a really fancy combobox that requires PIL to handle the graphics to make it look more native on Windows. It uses a popup menu to get an item out of list that is read in when it is created and is also editable. If you would like a stripped down version, I could probalby have it working in a day or so.
Sep 26 '06 #6
Thanks, I solved this problem:-) I give your a link, you may intereste that:

Python megawidgets(pmw)
http://sourceforge.net/projects/pmw

Description:
A toolkit for building high-level compound widgets in Python using the Tkinter module. It contains a set of flexible and extensible megawidgets, including notebooks, comboboxes, selection widgets, paned widgets, scrolled widgets and dialog windows.

By the way:
After reading the data set, I want to display points into an axes. For example, each point should have two values(education, experience) ie(10,20). Do you have any ideas for coding axes?? Thanks:-)

My final display should be something looks like the following picture:

my sample interface
Sep 26 '06 #7
bartonc
6,596 Expert 4TB
I recently switched from Tk to wxPython for a very complete and native look on Windows, but thank you for the link.

gnuplot module looks like it might work for you.
Sep 26 '06 #8
Thanks:-)

I have learned a lots from you, thanks

but I still have one question about adding multiple scalars to a single points in vtk, do you have any tips. I thought I should do something about data attribute, but I am not sure how to do it.

Thanks
Sep 26 '06 #9
bartonc
6,596 Expert 4TB
Perhaps you can find a copy of Hans Petter Langtangen's book "Python Scripting fo Computational Science" where all this kind of thing is taught.
Sep 27 '06 #10
I found the solution, thanks anyway:-)

you have given me a lots help, thanks! I really appreciate what you did
Sep 27 '06 #11

Sign in to post your reply or Sign up for a free account.

Similar topics

14
by: eastcoastguyz | last post by:
As I am learning PHP and seeing examples of handling graphics using the imagecreate functions. The few examples I have run across use PNG as the graphic file format of choice. Is there a reason for...
66
by: Robert Brewer | last post by:
The J2 proposal is as complete as it will ever be. http://www.aminus.org/rbre/python/pydec.html The patch is nearly complete; only the __future__ declaration and some document tweaks remain....
38
by: Jukka K. Korpela | last post by:
As well all know, valid markup is important... but when trying to find a convincing modern argument in favor of this, I found pages like http://www.htmlhelp.com/tools/validator/reasons.html which...
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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.