1#!/usr/bin/ruby 2 3require 'tk' 4require 'tkextlib/tcllib/plotchart' 5 6TkCanvas.new(:background=>'white', :width=>400, :height=>200){|c| 7 pack(:fill=>:both) 8 Tk::Tcllib::Plotchart::XYPlot.new(c, [0.0, 100.0, 10.0], 9 [0.0, 100.0, 20.0]){ 10 [ [0.0, 32.0], [10.0, 50.0], [25.0, 60.0], [78.0, 11.0] ].each{|x, y| 11 plot('series1', x, y) 12 } 13 title("Data series") 14 } 15} 16 17Tk.mainloop 18