Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > plot two data sets on gnuplot

Reply
Thread Tools

plot two data sets on gnuplot

 
 
開學了嗎?
Guest
Posts: n/a
 
      05-10-2004

I'm trying to write a script to pass a file of stock prices and volumes,
and plot the results on a gnuplot graph which is non-overlapped graph.

Fig. 1
------------
Fig. 2

Figure 1 is a graph of stock prices, and Figure 2 is a graph of stock volumes,
I'm trying to implement it as following codes,

g = Gnuplot.Gnuplot()
d1=Gnuplot.Data(self.days,self.open,self.high,self .low,self.close,
with='candlestick')
d2=Gnuplot.Data(self.days,self.volume,with='boxes' )
g.plot(d1,d2)

If anyone can get me back on track I'd appreciate it.

--
※Orgin : National Taipei University of Technology
Taiwan, Republic of China [redbbs.cc.ntut.edu.tw 140.124.6.202]
※FROM : 140.124.6.248
 
Reply With Quote
 
 
 
 
John Hunter
Guest
Posts: n/a
 
      05-11-2004
>>>>> "開學了嗎?" == 開學了嗎? <(E-Mail Removed)> writes:

> I'm trying to write a script to pass a file of stock
> prices and volumes, and plot the results on a gnuplot
> graph which is non-overlapped graph.


> Fig. 1 ------------ Fig. 2


> Figure 1 is a graph of stock prices, and Figure 2 is a
> graph of stock volumes, I'm trying to implement it as
> following codes,


I don't use gnuplot, but I just wanted to let you know that I recently
added a finance module for matplotlib
http://matplotlib.sourceforge.net that supports the kind of graph you
are trying to make. It's fairly minimalist now, but will grow in the
near future.

Here is a screenshot of a financial chart I made to show off some of
the finance features

http://nitace.bsd.uchicago.edu:8080/...nance_demo.png

If you're interested, you can check out the finance_demo.py example in
the matplotlib src distribution, and if you want to seem more example
code than you find in that dir, email me and I'll send some your way.

Good luck!
John Hunter

 
Reply With Quote
 
 
 
 
Fernando Perez
Guest
Posts: n/a
 
      05-15-2004
John Hunter wrote:

>>>>>> <(E-Mail Removed)> writes:

>
> > I'm trying to write a script to pass a file of stock
> > prices and volumes, and plot the results on a gnuplot
> > graph which is non-overlapped graph.

>
> > Fig. 1 ------------ Fig. 2

>
> > Figure 1 is a graph of stock prices, and Figure 2 is a
> > graph of stock volumes, I'm trying to implement it as
> > following codes,

>
> I don't use gnuplot, but I just wanted to let you know that I recently
> added a finance module for matplotlib
> http://matplotlib.sourceforge.net that supports the kind of graph you
> are trying to make. It's fairly minimalist now, but will grow in the
> near future.
>
> Here is a screenshot of a financial chart I made to show off some of
> the finance features
>
> http://nitace.bsd.uchicago.edu:8080/...nance_demo.png


I was going to tell you to look at 'multiplot' in gnuplot:

The command `set multiplot` places `gnuplot` in the multiplot mode, in which
several plots are placed on the same page, window, or screen.

....

But after seeing John's example, I honestly doubt it's worth the hassle with
Gnuplot. It would take a ridiculous amount of work with gnuplot to make that
kind of plot (and I've been using gnuplot since 1991!).

Time for me to finally check out matplotlib...

Best,

f
 
Reply With Quote
 
 
 
Reply

Thread Tools

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
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Using gnuplot to plot large data set under Windows XP Armin Armbruster Ruby 0 11-11-2008 03:25 PM
plot a 3D sphere from C++ using gnuplot? mlt C++ 7 09-05-2008 02:40 AM
two axis, two data sets GD::Graphic java Perl Misc 7 12-08-2006 12:55 PM
Why different sums for these two functions for large sets of data? Eric Lilja C++ 9 05-26-2005 12:42 AM
Variable size plot symbols, variable hue plot colors in Python (MatPlotLib) ? Dr. Colombes Python 1 02-10-2005 08:49 PM



Advertisments