# Wxruby and rgplot

**URL:** <https://www.ruby-forum.com/t/wxruby-and-rgplot/143295>\
**Category:** wxRuby\
**Created:** [July 17, 2008, 2:21am UTC](https://www.ruby-forum.com/t/wxruby-and-rgplot/143295 "2008-07-17T02:21:21Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![unebaguettesvp](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/47e85d/32.png) [@unebaguettesvp](https://www.ruby-forum.com/u/unebaguettesvp)\
**Post date:** [July 17, 2008, 2:21am UTC](https://www.ruby-forum.com/t/wxruby-and-rgplot/143295/1 "2008-07-17T02:21:21Z")

</div>

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!!!

---

<div class="post-metadata">

**Author:** ![unebaguettesvp](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/47e85d/32.png) [@unebaguettesvp](https://www.ruby-forum.com/u/unebaguettesvp)\
**Post date:** [July 18, 2008, 12:42am UTC](https://www.ruby-forum.com/t/wxruby-and-rgplot/143295/2 "2008-07-18T00:42:12Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![unebaguettesvp](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/47e85d/32.png) [@unebaguettesvp](https://www.ruby-forum.com/u/unebaguettesvp)\
**Post date:** [July 18, 2008, 1:42am UTC](https://www.ruby-forum.com/t/wxruby-and-rgplot/143295/3 "2008-07-18T01:42:36Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![unebaguettesvp](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/47e85d/32.png) [@unebaguettesvp](https://www.ruby-forum.com/u/unebaguettesvp)\
**Post date:** [July 18, 2008, 1:48am UTC](https://www.ruby-forum.com/t/wxruby-and-rgplot/143295/4 "2008-07-18T01:48:15Z")

</div>

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
