472,141 Members | 1,442 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,141 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 1130

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

6 posts views Thread by Richard | last post: by
4 posts views Thread by Rama Calaga | last post: by
1 post views Thread by Nicola Kaiser | last post: by
reply views Thread by bwaha | last post: by
3 posts views Thread by arslanburney | last post: by
reply views Thread by matthew43 | last post: by
reply views Thread by leo001 | last post: by

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.