Wxruby and rgplot

hi-

i’m really new to ruby (like 2 days new). so, i’m trying to plot a graph
inside a window. i’m using rgplot and wxruby. i can plot using rgplot
just fine. and i can create a window using wxruby. i just don’t know how
to combine the two. any ideas? where should i start learning? thanks!!!

Philip Rutkowski wrote:

i’m really new to ruby (like 2 days new). so, i’m trying to plot a graph
inside a window. i’m using rgplot and wxruby. i can plot using rgplot
just fine. and i can create a window using wxruby. i just don’t know how
to combine the two. any ideas? where should i start learning? thanks!!!

It’s not really clear what rgplot does from the home page, but I’m
assuming that it writes a chart of some sort to an image file eg a PNG.

If that’s right, the easiest way to combine it with wxRuby is to use
GnuPlot to write an image file, then paint that image file on a
Wx::Window using a DC (Device Context). The sample file
drawing/images.rb is a perfect simple example of how to do this.

cheers
alex

Alex F. wrote:

Philip Rutkowski wrote:

i’m really new to ruby (like 2 days new). so, i’m trying to plot a graph
inside a window. i’m using rgplot and wxruby. i can plot using rgplot
just fine. and i can create a window using wxruby. i just don’t know how
to combine the two. any ideas? where should i start learning? thanks!!!

It’s not really clear what rgplot does from the home page, but I’m
assuming that it writes a chart of some sort to an image file eg a PNG.

If that’s right, the easiest way to combine it with wxRuby is to use
GnuPlot to write an image file, then paint that image file on a
Wx::Window using a DC (Device Context). The sample file
drawing/images.rb is a perfect simple example of how to do this.

cheers
alex

that’s what i figured. one more question, where is the sample file
“images.rb” located? thanks for your time!

Philip Rutkowski wrote:

that’s what i figured. one more question, where is the sample file
“images.rb” located? thanks for your time!

Assuming you installed via rubygems, somewhere inside your ruby/lib
directory - something like

ruby/lib/VERSION/gems/wxruby-VERSION/samples/drawing

alex