Flash Website Builder- Trendy Site Builder is a Flash Site Building tool that helps users build stunning websites. Check Out Custom Custom Logo Design by LogoBee. Website Design and Free Logo Templates available.
 CodingForums.com Pythonxy
 User Name Remember Me? Password

Before you post, read our: Rules & Posting Guidelines

Enjoy an ad free experience by logging in. Not a member yet? Register.
 02-28-2011, 03:49 AM PM User | #1 StyleGranz New to the CF scene   Join Date: Feb 2011 Posts: 1 Thanks: 0 Thanked 0 Times in 0 Posts Pythonxy So I have been trying to use pythonxy to graph some data but have been having trouble getting the script I was given to work. The instructions I was given are as follows Code: ```* Now fire up your python shell: ipython -pylab This preloads numpy and matplotlib, but if you're using something else, make sure those two packages are loaded... numpy is a requirement for matplotlib anyway, but the advantage to loading it explicitly is that it makes the next step very easy: % idx, P, Pdot = loadtxt("psrcat-P-Pdot.dat", usecols=(0,2,3), unpack=True) If I didn't have loadtxt from numpy, I'd have to actually manually parse the data file, but that's not hard either. Here's a snippet of code that does something similar: f = open('myfile.txt', 'rU') for line in f: if(line.startswith('#')): print line.strip() else: x, y, z = line.split() But then you still need to load the x,y,z values into an array. Lets say loadtxt works for now. So now you have one-dimensional arrays which contain P and Pdot. Plot them up! % plot( log(P), log(Pdot), 'ro' ) And you're off.``` I really don't know much about python and trying to use pythonxy makes is a lot harder to figure out what I'm doing so any help is much appreciated. I have the data collected and saved correctly I know that much at least so if I can figure out how to get python to work then I should be good to go!
 01-29-2012, 04:37 AM PM User | #2 KevinJohnson Regular Coder   Join Date: May 2009 Location: China Posts: 133 Thanks: 1 Thanked 1 Time in 1 Post can you verify that all required modules are being loaded? Also, when you try this, is it giving you any kind of output? On the console, what kind of errors is it giving you? If it does actually display something on the plot window, what is it showing (or just plotting nothing at all) This is interesting to me, as i am also using pythonxy and moving from MatLab to Python (since Matlab refuses to support ATI GPUs...which are 3x better at integer math than Nvidia GPUs btw) ..i am also a bit new to Python, though not a n00b to programming by a long shot

 Bookmarks

 Thread Tools Rate This Thread Rate This Thread: 5 : Excellent 4 : Good 3 : Average 2 : Bad 1 : Terrible

 Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts BB code is On Smilies are On [IMG] code is On HTML code is Off Forum Rules
 Forum Jump User Control Panel Private Messages Subscriptions Who's Online Search Forums Forums Home :: Client side development     JavaScript programming         DOM and JSON scripting         Ajax and Design         JavaScript frameworks         Post a JavaScript     HTML & CSS     XML     Flash & ActionScript         Adobe Flex     Graphics and Multimedia discussions     General web building         Site reviews         Building for mobile devices :: Server side development     Apache configuration     Perl/ CGI     PHP         Post a PHP snippet     MySQL         Other Databases     Ruby & Ruby On Rails     ASP     ASP.NET     Java and JSP     Other server side languages/ issues         ColdFusion         Python :: Computing & Sciences     Computer Programming     Computer/PC discussions     Geek News and Humour Web Projects and Services Marketplace     Web Projects         Small projects (quick fixes and changes)         Medium projects (new script, new features, etc)         Large Projects (new web application, complex features etc)         Unknown sized projects (request quote)         Vacant job positions         Looking for work/ for hire         Project collaboration/ partnership         Paid work offers and requests (Now CLOSED)     Career, job, and business ideas or advice     Domains, Sites, and Designs for sale         Domains for sale         Websites for sale         Design templates and graphics for sale :: Other forums     Member Offers     Forum feedback and announcements

All times are GMT +1. The time now is 09:42 PM.