plot two data sets on gnuplot

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • ¶}¾Ç¤F¶Ü?

    plot two data sets on gnuplot


    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='candlesti ck')
    d2=Gnuplot.Data (self.days,self .volume,with='b oxes')
    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
  • John Hunter

    #2
    Re: plot two data sets on gnuplot

    >>>>> "¶}¾Ç¤F¶Ü?" == ¶}¾Ç¤F¶Ü? <casio.bbs@redb bs.cc.ntut.edu. tw> writes:
    [color=blue]
    > 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.[/color]
    [color=blue]
    > Fig. 1 ------------ Fig. 2[/color]
    [color=blue]
    > 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,[/color]

    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



    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

    Comment

    • Fernando Perez

      #3
      Re: plot two data sets on gnuplot

      John Hunter wrote:
      [color=blue][color=green][color=darkred]
      >>>>>> <casio.bbs@redb bs.cc.ntut.edu. tw> writes:[/color][/color]
      >[color=green]
      > > 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.[/color]
      >[color=green]
      > > Fig. 1 ------------ Fig. 2[/color]
      >[color=green]
      > > 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,[/color]
      >
      > 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[/color]

      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

      Comment

      Working...