Ruby Forum wxRuby > wxruby and rgplot

Posted by Philip Rutkowski (unebaguettesvp)
on 17.07.2008 02:21
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!!!
Posted by Alex Fenton (Guest)
on 18.07.2008 00:42
(Received via mailing list)
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
Posted by Philip Rutkowski (unebaguettesvp)
on 18.07.2008 01:42
Alex Fenton 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!
Posted by Alex Fenton (Guest)
on 18.07.2008 01:48
(Received via mailing list)
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