From: piir@... (Todd Gardner) Date: 2004-06-21T09:43:16+09:00 Subject: Re: Comparison of GLs for plotting (x,y,z) pts? alex fenton wrote in message news:<6dudnav0xY7PD0jdRVn-gw@eclipse.net.uk>... > Todd Gardner wrote: > > > My goal is to have my application plot arrays of (x,y) and possibly > > (x,y,z) data points in "real time". I would also like to write text > > on the graphs. I would like to ask for a knowledgeable comparison and > > contrast of the multitudes of graphic utility libraries out there > > capable of doing this seemingly SIMPLE plotting. > > ... > > > WxRuby - I don't know how to draw lines yet in this library. > > In WxRuby you could use a Device Context to draw lines, points, fills, > ellipses, etc, plus text onto a frame. For a full list of methods > available see the WxWidgets docs: > > http://www.wxwidgets.org/manuals/2.4.2/wx105.htm#wxdc > > I haven't used these classes in detail, so I don't know whether the > bindings are complete, but the following simple example worked for me > using wxruby-0.3.0 (current release is 0.4.0) > > chrz > alex > > --------------------------- > > require 'wxruby' > > class MyDrawingFrame < Wx::Frame > def initialize(*args) > super(*args) > evt_paint { on_paint } > end > def on_paint > paint do | dc | > dc.clear > dc.draw_line( 0, 0, 50, 100) > dc.draw_line( 50, 100, 100, 75) > dc.draw_text( 'a label', 52, 102) > end > end > end > > class MyApp < Wx::App > def on_init() > frame = MyDrawingFrame.new(nil, -1, 'Drawing') > frame.set_client_size( Wx::Size.new(200,200)) > frame.show() > end > end > > MyApp.new().main_loop() Hello Alex, While that's pretty easy. Thanks for showing me that! Todd