diff options
author | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-08-25 15:13:14 +0000 |
---|---|---|
committer | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-08-25 15:13:14 +0000 |
commit | d0233291bc8a5068e52c69c210e5979e5324b5bc (patch) | |
tree | 7d9459449c33792c63eeb7baa071e76352e0baab /trunk/ext/tk/sample/tkextlib/tcllib/plotdemos2.rb | |
parent | 0dc342de848a642ecce8db697b8fecd83a63e117 (diff) | |
parent | 72eaacaa15256ab95c3b52ea386f88586fb9da40 (diff) |
re-adding tag v1_9_0_4 as an alias of trunk@18848v1_9_0_4
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/tags/v1_9_0_4@18849 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'trunk/ext/tk/sample/tkextlib/tcllib/plotdemos2.rb')
-rw-r--r-- | trunk/ext/tk/sample/tkextlib/tcllib/plotdemos2.rb | 71 |
1 files changed, 0 insertions, 71 deletions
diff --git a/trunk/ext/tk/sample/tkextlib/tcllib/plotdemos2.rb b/trunk/ext/tk/sample/tkextlib/tcllib/plotdemos2.rb deleted file mode 100644 index 33a6f29940..0000000000 --- a/trunk/ext/tk/sample/tkextlib/tcllib/plotdemos2.rb +++ /dev/null @@ -1,71 +0,0 @@ -#!/usr/bin/ruby - -require 'tk' -require 'tkextlib/tcllib/plotchart' - -############################### - -c1 = TkCanvas.new(:background=>'white', :width=>400, :height=>200) -c2 = TkCanvas.new(:background=>'white', :width=>400, :height=>200) -Tk.pack(c1,c2, :fill=>:both, :side=>:top) - -############################### -# Set up a strip chart -############################### -slipchart = Tk::Tcllib::Plotchart::Stripchart.new(c1, [0.0, 100.0, 10.0], - [0.0, 100.0, 20.0]) - -TkTimer.new(500, -1, proc{|obj| # obj --> TkTimer object - slipchart, xold, xd, yold, yd = obj.return_value - xnew = xold + xd - ynew = yold + (rand() - 0.5) * yd - ynew2 = yold + (rand() - 0.5) * 2.0 * yd - slipchart.plot('series1', xnew, ynew) - slipchart.plot('series2', xnew, ynew2) - obj.stop if xnew >= 200 - [slipchart, xnew, xd, ynew, yd] # return_value - }).start(100, proc{ - # init return_value - [slipchart, 0.0, 15.0, 50.0, 30.0] - }) - -slipchart.title "Aha!" - -############################### -# Set up an isometric plot -############################### -s = Tk::Tcllib::Plotchart::IsometricPlot.new(c2, [0.0, 100.0], [0.0, 200.0], - :noaxes) - -s.set_zoom_pan - -s.plot('rectangle', [10.0, 10.0, 50.0, 50.0], 'green') -s.plot('filled-rectangle', [20.0, 20.0, 40.0, 40.0], 'red') -s.plot('filled-circle', [70.0, 70.0, 40.0], 'yellow') -s.plot('circle', [70.0, 70.0, 42.0]) - -############################### -# Check the symbols -############################### -h = TkToplevel.new(:title=>'h') -c = TkCanvas.new(h, :bg=>'white', :width=>400, :height=>200).pack(:fill=>:both) - -s = Tk::Tcllib::Plotchart::XYPlot.new(c, [0.0, 100.0, 10.0], - [0.0, 100.0, 20.0]) -s.dataconfig('series1', :colour=>'red', :type=>:symbol) -s.dataconfig('series2', :colour=>'green', :type=>:both) - -s.yconfig(:format=>"%12.2e") - -x = 5.0 -%w(plus cross circle up down dot upfilled downfilled).each{|sym| - s.dataconfig('series1', :symbol=>sym) - s.dataconfig('series2', :symbol=>sym) - s.plot('series1', x, 50.0) - s.plot('series2', x, 20) - x += 10 -} - -############################## - -Tk.mainloop |