plot two data sets on gnuplot

Discussion in 'Python' started by ¶}¾Ç¤F¶Ü?, May 10, 2004.

  1. 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
    ¶}¾Ç¤F¶Ü?, May 10, 2004
    #1
    1. Advertising

  2. ¶}¾Ç¤F¶Ü?

    John Hunter Guest

    >>>>> "¶}¾Ç¤F¶Ü?" == ¶}¾Ç¤F¶Ü? <> 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/files/share/finance_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
    John Hunter, May 11, 2004
    #2
    1. Advertising

  3. John Hunter wrote:

    >>>>>> <> 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/files/share/finance_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
    Fernando Perez, May 15, 2004
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Eric Lilja
    Replies:
    9
    Views:
    363
    Old Wolf
    May 26, 2005
  2. Dr. Colombes
    Replies:
    1
    Views:
    1,018
    John Hunter
    Feb 10, 2005
  3. mlt
    Replies:
    7
    Views:
    1,164
    Jerry Coffin
    Sep 5, 2008
  4. Armin Armbruster
    Replies:
    0
    Views:
    224
    Armin Armbruster
    Nov 11, 2008
  5. java
    Replies:
    7
    Views:
    268
Loading...

Share This Page