473,320 Members | 2,071 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.

Do a Gnuplot of a file in python


I am doing a python program that save the data in a text file in columns and
I want to do a gnuplot to plot the results.
But I want the program in python to show the result with gnuplot.
I have tried this:

g.load(power.p)

but it gives me this error:

Traceback (most recent call last):
File "./spectrum_output.py", line 310, in <module>
main_loop(tb)
File "./spectrum_output.py", line 289, in main_loop
g.load(power.p)
AttributeError: 'file' object has no attribute 'p'

On power.p I have this:

set autoscale
unset logscale
unset label
set xtic auto
set ytic auto
set title "Spectrum Analyzer"
set xlabel "Frecuency"
set ylabel "Power (dB)"
plot "power.dat" using 1:2 title 'm.data[0]' with linespoints

And in power.dat:
2231500000.0 18.2582263947
2234500000.0 17.0396003723
... ...
with more data

It goes ok when I load it in gnuplot, but not when I execute the python
program in the Terminal.

Thanks in advance!

Regards,

Santiago Ortega.
--
View this message in context: http://www.nabble.com/Do-a-Gnuplot-o...p20134007.html
Sent from the Python - python-list mailing list archive at Nabble.com.

Oct 23 '08 #1
0 1192

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

Similar topics

6
by: Richard | last post by:
I am going to need to plot some data and formula results from Python. A few years ago I used gnuplot (not from Python) and was wondering which Python plotting module I should use (learn)? I...
4
by: Rama Calaga | last post by:
Hi, I use both python and gnuplot a lot, but I am unable to find a way to embed gnuplot "window/canvas" into tkinter. BLT option in PMW is not so powerful and not so great, any suggestions ?? ...
7
by: Jive | last post by:
Here's my sitch: I use gnuplot.py at work, platform Win32. I want to upgrade to Python 2.4. Gnuplot.py uses extension module Numeric. Numeric is now "unsupported." The documentation says "If...
0
by: Cedric | last post by:
This is a 3 weeks old problem, but having found a solution (and having looked for one here, finding only this message), I'm replying now. From: Jive (someone@microsoft.com) Subject: Upgrade...
9
by: syd | last post by:
I don't even know where to begin. This is just bizarre. I just picked up the Gnuplot.py module (a light interface to gnuplot commands) and was messing around with it today. I've got a tiny...
1
by: Nicola Kaiser | last post by:
Hi, I´m using Gnuplot via gnuplot.py and I´m looking for a way to get the plotting output (terminal set to png in my case) piped in a string instead of to stdout or a file. Is there any...
0
by: bwaha | last post by:
I've posted this question to comp.graphics.apps.gnuplot too but given that this python group may also comprise a lot of gnuplot users, and is far more active, I've posted this question here too. My...
3
by: arslanburney | last post by:
Hello. Was trying to create a simple plotting function. Wasnt working however. If i write the same code without putting it inside a function it works. :S. Could some1 tell me the problem? Heres the...
0
by: matthew43 | last post by:
You might want to try g.reset() or something of the sort. i saw this post because I'm also trying to figure out gnuplot.py I can't seem to find proper documentation anywhere. unless its...
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...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
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...
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...
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...

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.