In [10]:
puts 'hoge'
hoge
In [11]:
10.times do |i|
  puts i
end
0
1
2
3
4
5
6
7
8
9
Out[11]:
10
In [12]:
IRuby.display IRuby.latex <<-'TEX'
\begin{eqnarray}
\nabla \times \vec{\mathbf{B}} -\, \frac1c\, \frac{\partial\vec{\mathbf{E}}}{\partial t} & = \frac{4\pi}{c}\vec{\mathbf{j}} \\
\nabla \cdot \vec{\mathbf{E}} & = 4 \pi \rho \\
\nabla \times \vec{\mathbf{E}}\, +\, \frac1c\, \frac{\partial\vec{\mathbf{B}}}{\partial t} & = \vec{\mathbf{0}} \\
\nabla \cdot \vec{\mathbf{B}} & = 0 
\end{eqnarray}
TEX

IRuby.math('F(k) = \int_{-\infty}^{\infty} f(x) e^{2\pi i k} dx')
Out[12]:
\begin{eqnarray} \nabla \times \vec{\mathbf{B}} -\, \frac1c\, \frac{\partial\vec{\mathbf{E}}}{\partial t} & = \frac{4\pi}{c}\vec{\mathbf{j}} \\ \nabla \cdot \vec{\mathbf{E}} & = 4 \pi \rho \\ \nabla \times \vec{\mathbf{E}}\, +\, \frac1c\, \frac{\partial\vec{\mathbf{B}}}{\partial t} & = \vec{\mathbf{0}} \\ \nabla \cdot \vec{\mathbf{B}} & = 0 \end{eqnarray}
Out[12]:
$$F(k) = \int_{-\infty}^{\infty} f(x) e^{2\pi i k} dx$$
In [13]:
IRuby.html '<iframe src=http://en.mobile.wikipedia.org/?useformat=mobile width=700 height=350></iframe>'
Out[13]:
In [14]:
ls Array
Array.methods: []  try_convert
Array#methods: 
  &            compact!    flatten   pack                  rotate      to_a     
  *            concat      flatten!  permutation           rotate!     to_ary   
  +            count       frozen?   pop                   sample      to_csv   
  -            cycle       hash      pretty_print          select      to_gplot 
  <<           delete      include?  pretty_print_cycle    select!     to_gsplot
  <=>          delete_at   index     product               shelljoin   to_h     
  ==           delete_if   insert    push                  shift       to_s     
  []           drop        inspect   rassoc                shuffle     transpose
  []=          drop_while  join      reject                shuffle!    uniq     
  assoc        each        keep_if   reject!               size        uniq!    
  at           each_index  last      repeated_combination  slice       unshift  
  bsearch      empty?      length    repeated_permutation  slice!      values_at
  clear        eql?        map       replace               sort        zip      
  collect      fetch       map!      reverse               sort!       |        
  collect!     fill        mean      reverse!              sort_by!  
  combination  find_index  median    reverse_each          take      
  compact      first       modes     rindex                take_while
In [15]:
require 'gnuplot'

Gnuplot::Plot.new do |plot|  
    plot.xrange '[-0.5:0.5]'
    plot.title  'Example plot'
    plot.ylabel 'x'
    plot.xlabel 'sin(1/x)'
    plot.samples 10000
    plot.data << Gnuplot::DataSet.new('sin(1/x)') do |ds|
        ds.with = 'lines'
        ds.linewidth = 2
    end
end
Out[15]:
Gnuplot Produced by GNUPLOT 4.6 patchlevel 6 -1 -0.8 -0.6 -0.4 -0.2 0 0.2 0.4 0.6 0.8 1 -0.4 -0.2 0 0.2 0.4 x sin(1/x) Example plot gnuplot_plot_1 sin(1/x)
In [16]:
require 'rubyvis'
    
Rubyvis::Panel.new do 
  width 150
  height 150
  bar do
    data [1, 1.2, 1.7, 1.5, 0.7, 0.3]
    width 20
    height {|d| d * 80}
    bottom(0)
    left {index * 25}
  end
end
Out[16]:
In [17]:
require 'gruff'
g = Gruff::Line.new
g.font = "/Library/Fonts/Osaka.ttf"
g.title = 'グラフ例'
g.data '大阪', [25, 36, 86, 39, 25, 31, 79, 88]
g.data '京都', [80, 54, 67, 54, 68, 70, 90, 95]
g.data '名古屋', [22, 29, 35, 38, 36, 40, 46, 57]
g.data '東京', [95, 95, 95, 90, 85, 80, 88, 100]
g.data 'さいたま', [90, 34, 23, 12, 78, 89, 98, 88]
g.data '群馬', [5, 10, 13, 11, 6, 16, 22, 32]
g
Out[17]:
In [18]:
require 'gnuplot'
Gnuplot::SPlot.new do |plot|
    plot.title 'Spiral'
    plot.nokey
    plot.parametric
    plot.hidden3d
    plot.view '80,50'
    plot.isosamples '60,15'
    plot.xrange '[-8:8]'
    plot.yrange '[-8:8]'
    plot.zrange '[-8:8]'
    plot.urange '[-2*pi:2*pi]'
    plot.vrange '[-pi:pi]'
    plot.data << Gnuplot::DataSet.new('cos(u)*(cos(v)+3), sin(u)*(cos(v)+3), sin(v)+u') do |ds|
        ds.with = 'lines'
    end
end
Out[18]:
Gnuplot Produced by GNUPLOT 4.6 patchlevel 6 Spiral gnuplot_plot_1 gnuplot_plot_2 -8 -6 -4 -2 0 2 4 6 8 -8 -6 -4 -2 0 2 4 6 8 -8 -6 -4 -2 0 2 4 6 8
In [19]:
require 'nyaplot'
require 'nyaplot3d'
Out[19]:
false
In [20]:
x=[];y=[];z=[]
-10.step(10, 0.5) do |i|
  -10.step(10, 0.5) do |j|
    x.push(i)
    y.push(j)
    z.push(Math.sin(Math.sqrt(i*i+j*j))/Math.sqrt(i*i+j*j))
  end
end
z.map!{|val| next (val.nan? ? 0 : val)} #(0,0) will be -inf
Out[20]:
[0.07070980527467927, 0.06825111305414358, 0.057630575489280585, 0.04034617895060916, 0.018552192423288767, -0.005305751788096055, -0.028845244812144625, -0.05003852305222089, -0.06740715089491094, -0.08010823579141367, -0.08792034505189632, -0.09115188436397047, -0.09050228958928583, -0.08690699622242735, -0.08139217990463421, -0.07495689987901655, -0.06849088196757172, -0.06272773781166564, -0.05822723495837525, -0.05537684587809335, -0.054402111088936986, -0.05537684587809335, -0.05822723495837525, -0.06272773781166564, -0.06849088196757172, -0.07495689987901655, -0.08139217990463421, -0.08690699622242735, -0.09050228958928583, -0.09115188436397047, -0.08792034505189632, -0.08010823579141367, -0.06740715089491094, -0.05003852305222089, -0.028845244812144625, -0.005305751788096055, 0.018552192423288767, 0.04034617895060916, 0.057630575489280585, 0.06825111305414358, 0.07070980527467927, 0.06825111305414358, 0.05682630444012635, 0.03796178393906856, 0.014135155449061411, -0.011763804124600832, -0.036874869103929196, -0.05874532782785397, -0.0755937821931744, -0.08643675803630407, -0.09108220848970375, -0.09001568643529065, -0.08421802680997838, -0.07495689987901655, -0.06358975846704862, -0.051405153532472825, -0.039516385641518936, -0.028809016621975873, -0.019934067090364063, -0.013332838992708288, -0.009277249905099167, -0.007910644259137822, -0.009277249905099167, -0.013332838992708288, -0.019934067090364063, -0.028809016621975873, -0.039516385641518936, -0.051405153532472825, -0.06358975846704862, -0.07495689987901655, -0.08421802680997838, -0.09001568643529065, -0.09108220848970375, -0.08643675803630407, -0.0755937821931744, -0.05874532782785397, -0.036874869103929196, -0.011763804124600832, 0.014135155449061411, 0.03796178393906856, 0.05682630444012635, 0.06825111305414358, 0.057630575489280585, 0.03796178393906856, 0.012637541642049447, -0.015014039828919575, -0.04160737907596747, -0.0641838159733434, -0.08056977983257328, -0.08956773031925042, -0.09097419633026813, -0.08545030284658549, -0.07429153508625874, -0.05915252370129161, -0.04177969822725026, -0.023792531570818704, -0.006536976075760194, 0.008983020970559483, 0.022104754680741474, 0.03245520841273295, 0.03987122267808871, 0.04431326426819208, 0.04579094280463962, 0.04431326426819208, 0.03987122267808871, 0.03245520841273295, 0.022104754680741474, 0.008983020970559483, -0.006536976075760194, -0.023792531570818704, -0.04177969822725026, -0.05915252370129161, -0.07429153508625874, -0.08545030284658549, -0.09097419633026813, -0.08956773031925042, -0.08056977983257328, -0.0641838159733434, -0.04160737907596747, -0.015014039828919575, 0.012637541642049447, 0.03796178393906856, 0.057630575489280585, 0.04034617895060916, 0.014135155449061411, -0.015014039828919575, -0.043166197954687714, -0.06677409789954362, -0.08316007856929132, -0.09080401018805377, -0.0894139480404508, -0.07979810941024242, -0.06358975846704862, -0.0428948164978531, -0.019934067090364063, 0.0032601210841151328, 0.025053744421125373, 0.04431326426819208, 0.06040720535198953, 0.07313012167416309, 0.08257932528697068, 0.08901491514755587, 0.09272862238309293, 0.09393966030864591, 0.09272862238309293, 0.08901491514755587, 0.08257932528697068, 0.07313012167416309, 0.06040720535198953, 0.04431326426819208, 0.025053744421125373, 0.0032601210841151328, -0.019934067090364063, -0.0428948164978531, -0.06358975846704862, -0.07979810941024242, -0.0894139480404508, -0.09080401018805377, -0.08316007856929132, -0.06677409789954362, -0.043166197954687714, -0.015014039828919575, 0.014135155449061411, 0.04034617895060916, 0.018552192423288767, -0.011763804124600832, -0.04160737907596747, -0.06677409789954362, -0.083953080486421, -0.09115188436397047, -0.08786057577066687, -0.07495689987901655, -0.054402111088936986, -0.028809016621975873, -0.000975520434412708, 0.026531247839761095, 0.05167865931507818, 0.07313012167416309, 0.09026587102554127, 0.1030892321900898, 0.11205862411281925, 0.11788827534862069, 0.121354197903323, 0.12313056789780169, 0.12366978082792272, 0.12313056789780169, 0.121354197903323, 0.11788827534862069, 0.11205862411281925, 0.1030892321900898, 0.09026587102554127, 0.07313012167416309, 0.05167865931507818, 0.026531247839761095, -0.000975520434412708, -0.028809016621975873, -0.054402111088936986, -0.07495689987901655, -0.08786057577066687, -0.09115188436397047, -0.083953080486421, -0.06677409789954362, -0.04160737907596747, -0.011763804124600832, 0.018552192423288767, -0.005305751788096055, -0.036874869103929196, -0.0641838159733434, -0.08316007856929132, -0.09115188436397047, -0.08723804412635582, -0.07221555931565682, -0.0483007953775875, -0.018630431167854764, 0.013324064862461696, 0.04431326426819208, 0.07174463418130257, 0.09393966030864591, 0.11020037089331168, 0.12071048357355876, 0.12632201382479508, 0.1282877460523285, 0.1279943847202572, 0.12673508793268007, 0.12554007460949038, 0.12506666356996518, 0.12554007460949038, 0.12673508793268007, 0.1279943847202572, 0.1282877460523285, 0.12632201382479508, 0.12071048357355876, 0.11020037089331168, 0.09393966030864591, 0.07174463418130257, 0.04431326426819208, 0.013324064862461696, -0.018630431167854764, -0.0483007953775875, -0.07221555931565682, -0.08723804412635582, -0.09115188436397047, -0.08316007856929132, -0.0641838159733434, -0.036874869103929196, -0.005305751788096055, -0.028845244812144625, -0.05874532782785397, -0.08056977983257328, -0.09080401018805377, -0.08786057577066687, -0.07221555931565682, -0.046172733100891844, -0.013332838992708288, 0.022104754680741474, 0.05606169383989521, 0.08518823525005793, 0.1072644357230806, 0.121354197903323, 0.12772614095633136, 0.12759863509556327, 0.1227899979382399, 0.11535613684707621, 0.10728003423923388, 0.10024812527586709, 0.09551761666147544, 0.09385522838839844, 0.09551761666147544, 0.10024812527586709, 0.10728003423923388, 0.11535613684707621, 0.1227899979382399, 0.12759863509556327, 0.12772614095633136, 0.121354197903323, 0.1072644357230806, 0.08518823525005793, 0.05606169383989521, 0.022104754680741474, -0.013332838992708288, -0.046172733100891844, -0.07221555931565682, -0.08786057577066687, -0.09080401018805377, -0.08056977983257328, -0.05874532782785397, -0.028845244812144625, -0.05003852305222089, -0.0755937821931744, -0.08956773031925042, -0.0894139480404508, -0.07495689987901655, -0.0483007953775875, -0.013332838992708288, 0.025053744421125373, 0.06184586593944633, 0.09272862238309293, 0.11468947045883603, 0.12632201382479508, 0.12781428895032207, 0.12067277845334438, 0.10728003423923388, 0.09040200935907733, 0.0727498464973691, 0.05666621451668113, 0.04395992890538335, 0.03586819257714133, 0.03309538278274085, 0.03586819257714133, 0.04395992890538335, 0.05666621451668113, 0.0727498464973691, 0.09040200935907733, 0.10728003423923388, 0.12067277845334438, 0.12781428895032207, 0.12632201382479508, 0.11468947045883603, 0.09272862238309293, 0.06184586593944633, 0.025053744421125373, -0.013332838992708288, -0.0483007953775875, -0.07495689987901655, -0.0894139480404508, -0.08956773031925042, -0.0755937821931744, -0.05003852305222089, -0.06740715089491094, -0.08643675803630407, -0.09097419633026813, -0.07979810941024242, -0.054402111088936986, -0.018630431167854764, 0.022104754680741474, 0.06184586593944633, 0.09513663192183475, 0.11788827534862069, 0.12791446519229313, 0.12506666356996518, 0.1109917734500386, 0.0886111876940622, 0.061467682588178515, 0.03309538278274085, 0.0065393077343296625, -0.015905088066645427, -0.032729152507152436, -0.04308193095821112, -0.04656924969982098, -0.04308193095821112, -0.032729152507152436, -0.015905088066645427, 0.0065393077343296625, 0.03309538278274085, 0.061467682588178515, 0.0886111876940622, 0.1109917734500386, 0.12506666356996518, 0.12791446519229313, 0.11788827534862069, 0.09513663192183475, 0.06184586593944633, 0.022104754680741474, -0.018630431167854764, -0.054402111088936986, -0.07979810941024242, -0.09097419633026813, -0.08643675803630407, -0.06740715089491094, -0.08010823579141367, -0.09108220848970375, -0.08545030284658549, -0.06358975846704862, -0.028809016621975873, 0.013324064862461696, 0.05606169383989521, 0.09272862238309293, 0.11788827534862069, 0.12819563383513788, 0.1227899979382399, 0.10318836687199265, 0.0727498464973691, 0.03586819257714133, -0.0029053968069243366, -0.0396120270827976, -0.07136107141075335, -0.0964681698772501, -0.11428272813296206, -0.12481027146866008, -0.1282800591946167, -0.12481027146866008, -0.11428272813296206, -0.0964681698772501, -0.07136107141075335, -0.0396120270827976, -0.0029053968069243366, 0.03586819257714133, 0.0727498464973691, 0.10318836687199265, 0.1227899979382399, 0.12819563383513788, 0.11788827534862069, 0.09272862238309293, 0.05606169383989521, 0.013324064862461696, -0.028809016621975873, -0.06358975846704862, -0.08545030284658549, -0.09108220848970375, -0.08010823579141367, -0.08792034505189632, -0.09001568643529065, -0.07429153508625874, -0.0428948164978531, -0.000975520434412708, 0.04431326426819208, 0.08518823525005793, 0.11468947045883603, 0.12791446519229313, 0.1227899979382399, 0.10024812527586709, 0.06380703560977322, 0.018686436816934687, -0.02931843708828789, -0.07494068295407723, -0.11428272813296206, -0.14523137672394124, -0.16739618809597498, -0.18163979110507836, -0.1893661116834589, -0.1917848549326277, -0.1893661116834589, -0.18163979110507836, -0.16739618809597498, -0.14523137672394124, -0.11428272813296206, -0.07494068295407723, -0.02931843708828789, 0.018686436816934687, 0.06380703560977322, 0.10024812527586709, 0.1227899979382399, 0.12791446519229313, 0.11468947045883603, 0.08518823525005793, 0.04431326426819208, -0.000975520434412708, -0.0428948164978531, -0.07429153508625874, -0.09001568643529065, -0.08792034505189632, -0.09115188436397047, -0.08421802680997838, -0.05915252370129161, -0.019934067090364063, 0.026531247839761095, 0.07174463418130257, 0.1072644357230806, 0.12632201382479508, 0.12506666356996518, 0.10318836687199265, 0.06380703560977322, 0.012678882219140044, -0.04308193095821112, -0.0964681698772501, -0.1419020591482169, -0.17613111363996398, -0.1985212210673702, -0.21071704065734573, -0.21578929942337413, -0.217106624273501, -0.21722891503668823, -0.217106624273501, -0.21578929942337413, -0.21071704065734573, -0.1985212210673702, -0.17613111363996398, -0.1419020591482169, -0.0964681698772501, -0.04308193095821112, 0.012678882219140044, 0.06380703560977322, 0.10318836687199265, 0.12506666356996518, 0.12632201382479508, 0.1072644357230806, 0.07174463418130257, 0.026531247839761095, -0.019934067090364063, -0.05915252370129161, -0.08421802680997838, -0.09115188436397047, -0.09050228958928583, -0.07495689987901655, -0.04177969822725026, 0.0032601210841151328, 0.05167865931507818, 0.09393966030864591, 0.121354197903323, 0.12781428895032207, 0.1109917734500386, 0.0727498464973691, 0.018686436816934687, -0.04308193095821112, -0.10362229026069987, -0.1549964036247235, -0.1917848549326277, -0.21199733150313538, -0.21718431835123952, -0.2117477327821936, -0.20162936743561297, -0.19269534164247412, -0.18920062382698205, -0.19269534164247412, -0.20162936743561297, -0.2117477327821936, -0.21718431835123952, -0.21199733150313538, -0.1917848549326277, -0.1549964036247235, -0.10362229026069987, -0.04308193095821112, 0.018686436816934687, 0.0727498464973691, 0.1109917734500386, 0.12781428895032207, 0.121354197903323, 0.09393966030864591, 0.05167865931507818, 0.0032601210841151328, -0.04177969822725026, -0.07495689987901655, -0.09050228958928583, -0.08690699622242735, -0.06358975846704862, -0.023792531570818704, 0.025053744421125373, 0.07313012167416309, 0.11020037089331168, 0.12772614095633136, 0.12067277845334438, 0.0886111876940622, 0.03586819257714133, -0.02931843708828789, -0.0964681698772501, -0.1549964036247235, -0.19636607441272252, -0.21578929942337413, -0.21311244844710367, -0.19269534164247412, -0.162314921526778, -0.13133744216365315, -0.10856373127183089, -0.10022377933989138, -0.10856373127183089, -0.13133744216365315, -0.162314921526778, -0.19269534164247412, -0.21311244844710367, -0.21578929942337413, -0.19636607441272252, -0.1549964036247235, -0.0964681698772501, -0.02931843708828789, 0.03586819257714133, 0.0886111876940622, 0.12067277845334438, 0.12772614095633136, 0.11020037089331168, 0.07313012167416309, 0.025053744421125373, -0.023792531570818704, -0.06358975846704862, -0.08690699622242735, -0.08139217990463421, -0.051405153532472825, -0.006536976075760194, 0.04431326426819208, 0.09026587102554127, 0.12071048357355876, 0.12759863509556327, 0.10728003423923388, 0.061467682588178515, -0.0029053968069243366, -0.07494068295407723, -0.1419020591482169, -0.1917848549326277, -0.21578929942337413, -0.21017152293525476, -0.17706921681216475, -0.12411188138749578, -0.0628822344847537, -0.0065407069689387, 0.03289418131823631, 0.0470400026866224, 0.03289418131823631, -0.0065407069689387, -0.0628822344847537, -0.12411188138749578, -0.17706921681216475, -0.21017152293525476, -0.21578929942337413, -0.1917848549326277, -0.1419020591482169, -0.07494068295407723, -0.0029053968069243366, 0.061467682588178515, 0.10728003423923388, 0.12759863509556327, 0.12071048357355876, 0.09026587102554127, 0.04431326426819208, -0.006536976075760194, -0.051405153532472825, -0.08139217990463421, -0.07495689987901655, -0.039516385641518936, 0.008983020970559483, 0.06040720535198953, 0.1030892321900898, 0.12632201382479508, 0.1227899979382399, 0.09040200935907733, 0.03309538278274085, -0.0396120270827976, -0.11428272813296206, -0.17613111363996398, -0.21199733150313538, -0.21311244844710367, -0.17706921681216475, -0.10856373127183089, -0.018720088601135637, 0.07689817560810494, 0.16121107496476533, 0.21890113461039087, 0.23938885764158258, 0.21890113461039087, 0.16121107496476533, 0.07689817560810494, -0.018720088601135637, -0.10856373127183089, -0.17706921681216475, -0.21311244844710367, -0.21199733150313538, -0.17613111363996398, -0.11428272813296206, -0.0396120270827976, 0.03309538278274085, 0.09040200935907733, 0.1227899979382399, 0.12632201382479508, 0.1030892321900898, 0.06040720535198953, 0.008983020970559483, -0.039516385641518936, -0.07495689987901655, -0.06849088196757172, -0.028809016621975873, 0.022104754680741474, 0.07313012167416309, 0.11205862411281925, 0.1282877460523285, 0.11535613684707621, 0.0727498464973691, 0.0065393077343296625, -0.07136107141075335, -0.14523137672394124, -0.1985212210673702, -0.21718431835123952, -0.19269534164247412, -0.12411188138749578, -0.018720088601135637, 0.10891980905843199, 0.23938885764158258, 0.35184490787569894, 0.4278214842691431, 0.45464871341284085, 0.4278214842691431, 0.35184490787569894, 0.23938885764158258, 0.10891980905843199, -0.018720088601135637, -0.12411188138749578, -0.19269534164247412, -0.21718431835123952, -0.1985212210673702, -0.14523137672394124, -0.07136107141075335, 0.0065393077343296625, 0.0727498464973691, 0.11535613684707621, 0.1282877460523285, 0.11205862411281925, 0.07313012167416309, 0.022104754680741474, -0.028809016621975873, -0.06849088196757172, -0.06272773781166564, -0.019934067090364063, 0.03245520841273295, 0.08257932528697068, 0.11788827534862069, 0.1279943847202572, 0.10728003423923388, 0.05666621451668113, -0.015905088066645427, -0.0964681698772501, -0.16739618809597498, -0.21071704065734573, -0.2117477327821936, -0.162314921526778, -0.0628822344847537, 0.07689817560810494, 0.23938885764158258, 0.4017547423895375, 0.5398415805455232, 0.6324217062813903, 0.6649966577360363, 0.6324217062813903, 0.5398415805455232, 0.4017547423895375, 0.23938885764158258, 0.07689817560810494, -0.0628822344847537, -0.162314921526778, -0.2117477327821936, -0.21071704065734573, -0.16739618809597498, -0.0964681698772501, -0.015905088066645427, 0.05666621451668113, 0.10728003423923388, 0.1279943847202572, 0.11788827534862069, 0.08257932528697068, 0.03245520841273295, -0.019934067090364063, -0.06272773781166564, -0.05822723495837525, -0.013332838992708288, 0.03987122267808871, 0.08901491514755587, 0.121354197903323, 0.12673508793268007, 0.10024812527586709, 0.04395992890538335, -0.032729152507152436, -0.11428272813296206, -0.18163979110507836, -0.21578929942337413, -0.20162936743561297, -0.13133744216365315, -0.0065407069689387, 0.16121107496476533, 0.35184490787569894, 0.5398415805455232, 0.6984559986366083, 0.804306627215558, 0.8414709848078965, 0.804306627215558, 0.6984559986366083, 0.5398415805455232, 0.35184490787569894, 0.16121107496476533, -0.0065407069689387, -0.13133744216365315, -0.20162936743561297, -0.21578929942337413, -0.18163979110507836, -0.11428272813296206, -0.032729152507152436, 0.04395992890538335, 0.10024812527586709, 0.12673508793268007, 0.121354197903323, 0.08901491514755587, 0.03987122267808871, -0.013332838992708288, -0.05822723495837525, -0.05537684587809335, -0.009277249905099167, 0.04431326426819208, 0.09272862238309293, 0.12313056789780169, 0.12554007460949038, 0.09551761666147544, 0.03586819257714133, -0.04308193095821112, -0.12481027146866008, -0.1893661116834589, -0.217106624273501, -0.19269534164247412, -0.10856373127183089, 0.03289418131823631, 0.21890113461039087, 0.4278214842691431, 0.6324217062813903, 0.804306627215558, 0.9187253698655684, 0.958851077208406, 0.9187253698655684, 0.804306627215558, 0.6324217062813903, 0.4278214842691431, 0.21890113461039087, 0.03289418131823631, -0.10856373127183089, -0.19269534164247412, -0.217106624273501, -0.1893661116834589, -0.12481027146866008, -0.04308193095821112, 0.03586819257714133, 0.09551761666147544, 0.12554007460949038, 0.12313056789780169, 0.09272862238309293, 0.04431326426819208, -0.009277249905099167, -0.05537684587809335, -0.054402111088936986, -0.007910644259137822, 0.04579094280463962, 0.09393966030864591, 0.12366978082792272, 0.12506666356996518, 0.09385522838839844, 0.03309538278274085, -0.04656924969982098, -0.1282800591946167, -0.1917848549326277, -0.21722891503668823, -0.18920062382698205, -0.10022377933989138, 0.0470400026866224, 0.23938885764158258, 0.45464871341284085, 0.6649966577360363, 0.8414709848078965, 0.958851077208406, 0, 0.958851077208406, 0.8414709848078965, 0.6649966577360363, 0.45464871341284085, 0.23938885764158258, 0.0470400026866224, -0.10022377933989138, -0.18920062382698205, -0.21722891503668823, -0.1917848549326277, -0.1282800591946167, -0.04656924969982098, 0.03309538278274085, 0.09385522838839844, 0.12506666356996518, 0.12366978082792272, 0.09393966030864591, 0.04579094280463962, -0.007910644259137822, -0.054402111088936986, -0.05537684587809335, -0.009277249905099167, 0.04431326426819208, 0.09272862238309293, 0.12313056789780169, 0.12554007460949038, 0.09551761666147544, 0.03586819257714133, -0.04308193095821112, -0.12481027146866008, -0.1893661116834589, -0.217106624273501, -0.19269534164247412, -0.10856373127183089, 0.03289418131823631, 0.21890113461039087, 0.4278214842691431, 0.6324217062813903, 0.804306627215558, 0.9187253698655684, 0.958851077208406, 0.9187253698655684, 0.804306627215558, 0.6324217062813903, 0.4278214842691431, 0.21890113461039087, 0.03289418131823631, -0.10856373127183089, -0.19269534164247412, -0.217106624273501, -0.1893661116834589, -0.12481027146866008, -0.04308193095821112, 0.03586819257714133, 0.09551761666147544, 0.12554007460949038, 0.12313056789780169, 0.09272862238309293, 0.04431326426819208, -0.009277249905099167, -0.05537684587809335, -0.05822723495837525, -0.013332838992708288, 0.03987122267808871, 0.08901491514755587, 0.121354197903323, 0.12673508793268007, 0.10024812527586709, 0.04395992890538335, -0.032729152507152436, -0.11428272813296206, -0.18163979110507836, -0.21578929942337413, -0.20162936743561297, -0.13133744216365315, -0.0065407069689387, 0.16121107496476533, 0.35184490787569894, 0.5398415805455232, 0.6984559986366083, 0.804306627215558, 0.8414709848078965, 0.804306627215558, 0.6984559986366083, 0.5398415805455232, 0.35184490787569894, 0.16121107496476533, -0.0065407069689387, -0.13133744216365315, -0.20162936743561297, -0.21578929942337413, -0.18163979110507836, -0.11428272813296206, -0.032729152507152436, 0.04395992890538335, 0.10024812527586709, 0.12673508793268007, 0.121354197903323, 0.08901491514755587, 0.03987122267808871, -0.013332838992708288, -0.05822723495837525, -0.06272773781166564, -0.019934067090364063, 0.03245520841273295, 0.08257932528697068, 0.11788827534862069, 0.1279943847202572, 0.10728003423923388, 0.05666621451668113, -0.015905088066645427, -0.0964681698772501, -0.16739618809597498, -0.21071704065734573, -0.2117477327821936, -0.162314921526778, -0.0628822344847537, 0.07689817560810494, 0.23938885764158258, 0.4017547423895375, 0.5398415805455232, 0.6324217062813903, 0.6649966577360363, 0.6324217062813903, 0.5398415805455232, 0.4017547423895375, 0.23938885764158258, 0.07689817560810494, -0.0628822344847537, -0.162314921526778, -0.2117477327821936, -0.21071704065734573, -0.16739618809597498, -0.0964681698772501, -0.015905088066645427, 0.05666621451668113, 0.10728003423923388, 0.1279943847202572, 0.11788827534862069, 0.08257932528697068, 0.03245520841273295, -0.019934067090364063, -0.06272773781166564, -0.06849088196757172, -0.028809016621975873, 0.022104754680741474, 0.07313012167416309, 0.11205862411281925, 0.1282877460523285, 0.11535613684707621, 0.0727498464973691, 0.0065393077343296625, -0.07136107141075335, -0.14523137672394124, -0.1985212210673702, -0.21718431835123952, -0.19269534164247412, -0.12411188138749578, -0.018720088601135637, 0.10891980905843199, 0.23938885764158258, 0.35184490787569894, 0.4278214842691431, 0.45464871341284085, 0.4278214842691431, 0.35184490787569894, 0.23938885764158258, 0.10891980905843199, -0.018720088601135637, -0.12411188138749578, -0.19269534164247412, -0.21718431835123952, -0.1985212210673702, -0.14523137672394124, -0.07136107141075335, 0.0065393077343296625, 0.0727498464973691, 0.11535613684707621, 0.1282877460523285, 0.11205862411281925, 0.07313012167416309, 0.022104754680741474, -0.028809016621975873, -0.06849088196757172, -0.07495689987901655, -0.039516385641518936, 0.008983020970559483, 0.06040720535198953, 0.1030892321900898, 0.12632201382479508, 0.1227899979382399, 0.09040200935907733, 0.03309538278274085, -0.0396120270827976, -0.11428272813296206, -0.17613111363996398, -0.21199733150313538, -0.21311244844710367, -0.17706921681216475, -0.10856373127183089, -0.018720088601135637, 0.07689817560810494, 0.16121107496476533, 0.21890113461039087, 0.23938885764158258, 0.21890113461039087, 0.16121107496476533, 0.07689817560810494, -0.018720088601135637, -0.10856373127183089, -0.17706921681216475, -0.21311244844710367, -0.21199733150313538, -0.17613111363996398, -0.11428272813296206, -0.0396120270827976, 0.03309538278274085, 0.09040200935907733, 0.1227899979382399, 0.12632201382479508, 0.1030892321900898, 0.06040720535198953, 0.008983020970559483, -0.039516385641518936, -0.07495689987901655, -0.08139217990463421, -0.051405153532472825, -0.006536976075760194, 0.04431326426819208, 0.09026587102554127, 0.12071048357355876, 0.12759863509556327, 0.10728003423923388, 0.061467682588178515, -0.0029053968069243366, -0.07494068295407723, -0.1419020591482169, -0.1917848549326277, -0.21578929942337413, -0.21017152293525476, -0.17706921681216475, -0.12411188138749578, -0.0628822344847537, -0.0065407069689387, 0.03289418131823631, 0.0470400026866224, 0.03289418131823631, -0.0065407069689387, -0.0628822344847537, -0.12411188138749578, -0.17706921681216475, -0.21017152293525476, -0.21578929942337413, -0.1917848549326277, -0.1419020591482169, -0.07494068295407723, -0.0029053968069243366, 0.061467682588178515, 0.10728003423923388, 0.12759863509556327, 0.12071048357355876, 0.09026587102554127, 0.04431326426819208, -0.006536976075760194, -0.051405153532472825, -0.08139217990463421, -0.08690699622242735, -0.06358975846704862, -0.023792531570818704, 0.025053744421125373, 0.07313012167416309, 0.11020037089331168, 0.12772614095633136, 0.12067277845334438, 0.0886111876940622, 0.03586819257714133, -0.02931843708828789, -0.0964681698772501, -0.1549964036247235, -0.19636607441272252, -0.21578929942337413, -0.21311244844710367, -0.19269534164247412, -0.162314921526778, -0.13133744216365315, -0.10856373127183089, -0.10022377933989138, -0.10856373127183089, -0.13133744216365315, -0.162314921526778, -0.19269534164247412, -0.21311244844710367, -0.21578929942337413, -0.19636607441272252, -0.1549964036247235, -0.0964681698772501, -0.02931843708828789, 0.03586819257714133, 0.0886111876940622, 0.12067277845334438, 0.12772614095633136, 0.11020037089331168, 0.07313012167416309, 0.025053744421125373, -0.023792531570818704, -0.06358975846704862, -0.08690699622242735, -0.09050228958928583, -0.07495689987901655, -0.04177969822725026, 0.0032601210841151328, 0.05167865931507818, 0.09393966030864591, 0.121354197903323, 0.12781428895032207, 0.1109917734500386, 0.0727498464973691, 0.018686436816934687, -0.04308193095821112, -0.10362229026069987, -0.1549964036247235, -0.1917848549326277, -0.21199733150313538, -0.21718431835123952, -0.2117477327821936, -0.20162936743561297, -0.19269534164247412, -0.18920062382698205, -0.19269534164247412, -0.20162936743561297, -0.2117477327821936, -0.21718431835123952, -0.21199733150313538, -0.1917848549326277, -0.1549964036247235, -0.10362229026069987, -0.04308193095821112, 0.018686436816934687, 0.0727498464973691, 0.1109917734500386, 0.12781428895032207, 0.121354197903323, 0.09393966030864591, 0.05167865931507818, 0.0032601210841151328, -0.04177969822725026, -0.07495689987901655, -0.09050228958928583, -0.09115188436397047, -0.08421802680997838, -0.05915252370129161, -0.019934067090364063, 0.026531247839761095, 0.07174463418130257, 0.1072644357230806, 0.12632201382479508, 0.12506666356996518, 0.10318836687199265, 0.06380703560977322, 0.012678882219140044, -0.04308193095821112, -0.0964681698772501, -0.1419020591482169, -0.17613111363996398, -0.1985212210673702, -0.21071704065734573, -0.21578929942337413, -0.217106624273501, -0.21722891503668823, -0.217106624273501, -0.21578929942337413, -0.21071704065734573, -0.1985212210673702, -0.17613111363996398, -0.1419020591482169, -0.0964681698772501, -0.04308193095821112, 0.012678882219140044, 0.06380703560977322, 0.10318836687199265, 0.12506666356996518, 0.12632201382479508, 0.1072644357230806, 0.07174463418130257, 0.026531247839761095, -0.019934067090364063, -0.05915252370129161, -0.08421802680997838, -0.09115188436397047, -0.08792034505189632, -0.09001568643529065, -0.07429153508625874, -0.0428948164978531, -0.000975520434412708, 0.04431326426819208, 0.08518823525005793, 0.11468947045883603, 0.12791446519229313, 0.1227899979382399, 0.10024812527586709, 0.06380703560977322, 0.018686436816934687, -0.02931843708828789, -0.07494068295407723, -0.11428272813296206, -0.14523137672394124, -0.16739618809597498, -0.18163979110507836, -0.1893661116834589, -0.1917848549326277, -0.1893661116834589, -0.18163979110507836, -0.16739618809597498, -0.14523137672394124, -0.11428272813296206, -0.07494068295407723, -0.02931843708828789, 0.018686436816934687, 0.06380703560977322, 0.10024812527586709, 0.1227899979382399, 0.12791446519229313, 0.11468947045883603, 0.08518823525005793, 0.04431326426819208, -0.000975520434412708, -0.0428948164978531, -0.07429153508625874, -0.09001568643529065, -0.08792034505189632, -0.08010823579141367, -0.09108220848970375, -0.08545030284658549, -0.06358975846704862, -0.028809016621975873, 0.013324064862461696, 0.05606169383989521, 0.09272862238309293, 0.11788827534862069, 0.12819563383513788, 0.1227899979382399, 0.10318836687199265, 0.0727498464973691, 0.03586819257714133, -0.0029053968069243366, -0.0396120270827976, -0.07136107141075335, -0.0964681698772501, -0.11428272813296206, -0.12481027146866008, -0.1282800591946167, -0.12481027146866008, -0.11428272813296206, -0.0964681698772501, -0.07136107141075335, -0.0396120270827976, -0.0029053968069243366, 0.03586819257714133, 0.0727498464973691, 0.10318836687199265, 0.1227899979382399, 0.12819563383513788, 0.11788827534862069, 0.09272862238309293, 0.05606169383989521, 0.013324064862461696, -0.028809016621975873, -0.06358975846704862, -0.08545030284658549, -0.09108220848970375, -0.08010823579141367, -0.06740715089491094, -0.08643675803630407, -0.09097419633026813, -0.07979810941024242, -0.054402111088936986, -0.018630431167854764, 0.022104754680741474, 0.06184586593944633, 0.09513663192183475, 0.11788827534862069, 0.12791446519229313, 0.12506666356996518, 0.1109917734500386, 0.0886111876940622, 0.061467682588178515, 0.03309538278274085, 0.0065393077343296625, -0.015905088066645427, -0.032729152507152436, -0.04308193095821112, -0.04656924969982098, -0.04308193095821112, -0.032729152507152436, -0.015905088066645427, 0.0065393077343296625, 0.03309538278274085, 0.061467682588178515, 0.0886111876940622, 0.1109917734500386, 0.12506666356996518, 0.12791446519229313, 0.11788827534862069, 0.09513663192183475, 0.06184586593944633, 0.022104754680741474, -0.018630431167854764, -0.054402111088936986, -0.07979810941024242, -0.09097419633026813, -0.08643675803630407, -0.06740715089491094, -0.05003852305222089, -0.0755937821931744, -0.08956773031925042, -0.0894139480404508, -0.07495689987901655, -0.0483007953775875, -0.013332838992708288, 0.025053744421125373, 0.06184586593944633, 0.09272862238309293, 0.11468947045883603, 0.12632201382479508, 0.12781428895032207, 0.12067277845334438, 0.10728003423923388, 0.09040200935907733, 0.0727498464973691, 0.05666621451668113, 0.04395992890538335, 0.03586819257714133, 0.03309538278274085, 0.03586819257714133, 0.04395992890538335, 0.05666621451668113, 0.0727498464973691, 0.09040200935907733, 0.10728003423923388, 0.12067277845334438, 0.12781428895032207, 0.12632201382479508, 0.11468947045883603, 0.09272862238309293, 0.06184586593944633, 0.025053744421125373, -0.013332838992708288, -0.0483007953775875, -0.07495689987901655, -0.0894139480404508, -0.08956773031925042, -0.0755937821931744, -0.05003852305222089, -0.028845244812144625, -0.05874532782785397, -0.08056977983257328, -0.09080401018805377, -0.08786057577066687, -0.07221555931565682, -0.046172733100891844, -0.013332838992708288, 0.022104754680741474, 0.05606169383989521, 0.08518823525005793, 0.1072644357230806, 0.121354197903323, 0.12772614095633136, 0.12759863509556327, 0.1227899979382399, 0.11535613684707621, 0.10728003423923388, 0.10024812527586709, 0.09551761666147544, 0.09385522838839844, 0.09551761666147544, 0.10024812527586709, 0.10728003423923388, 0.11535613684707621, 0.1227899979382399, 0.12759863509556327, 0.12772614095633136, 0.121354197903323, 0.1072644357230806, 0.08518823525005793, 0.05606169383989521, 0.022104754680741474, -0.013332838992708288, -0.046172733100891844, -0.07221555931565682, -0.08786057577066687, -0.09080401018805377, -0.08056977983257328, -0.05874532782785397, -0.028845244812144625, -0.005305751788096055, -0.036874869103929196, -0.0641838159733434, -0.08316007856929132, -0.09115188436397047, -0.08723804412635582, -0.07221555931565682, -0.0483007953775875, -0.018630431167854764, 0.013324064862461696, 0.04431326426819208, 0.07174463418130257, 0.09393966030864591, 0.11020037089331168, 0.12071048357355876, 0.12632201382479508, 0.1282877460523285, 0.1279943847202572, 0.12673508793268007, 0.12554007460949038, 0.12506666356996518, 0.12554007460949038, 0.12673508793268007, 0.1279943847202572, 0.1282877460523285, 0.12632201382479508, 0.12071048357355876, 0.11020037089331168, 0.09393966030864591, 0.07174463418130257, 0.04431326426819208, 0.013324064862461696, -0.018630431167854764, -0.0483007953775875, -0.07221555931565682, -0.08723804412635582, -0.09115188436397047, -0.08316007856929132, -0.0641838159733434, -0.036874869103929196, -0.005305751788096055, 0.018552192423288767, -0.011763804124600832, -0.04160737907596747, -0.06677409789954362, -0.083953080486421, -0.09115188436397047, -0.08786057577066687, -0.07495689987901655, -0.054402111088936986, -0.028809016621975873, -0.000975520434412708, 0.026531247839761095, 0.05167865931507818, 0.07313012167416309, 0.09026587102554127, 0.1030892321900898, 0.11205862411281925, 0.11788827534862069, 0.121354197903323, 0.12313056789780169, 0.12366978082792272, 0.12313056789780169, 0.121354197903323, 0.11788827534862069, 0.11205862411281925, 0.1030892321900898, 0.09026587102554127, 0.07313012167416309, 0.05167865931507818, 0.026531247839761095, -0.000975520434412708, -0.028809016621975873, -0.054402111088936986, -0.07495689987901655, -0.08786057577066687, -0.09115188436397047, -0.083953080486421, -0.06677409789954362, -0.04160737907596747, -0.011763804124600832, 0.018552192423288767, 0.04034617895060916, 0.014135155449061411, -0.015014039828919575, -0.043166197954687714, -0.06677409789954362, -0.08316007856929132, -0.09080401018805377, -0.0894139480404508, -0.07979810941024242, -0.06358975846704862, -0.0428948164978531, -0.019934067090364063, 0.0032601210841151328, 0.025053744421125373, 0.04431326426819208, 0.06040720535198953, 0.07313012167416309, 0.08257932528697068, 0.08901491514755587, 0.09272862238309293, 0.09393966030864591, 0.09272862238309293, 0.08901491514755587, 0.08257932528697068, 0.07313012167416309, 0.06040720535198953, 0.04431326426819208, 0.025053744421125373, 0.0032601210841151328, -0.019934067090364063, -0.0428948164978531, -0.06358975846704862, -0.07979810941024242, -0.0894139480404508, -0.09080401018805377, -0.08316007856929132, -0.06677409789954362, -0.043166197954687714, -0.015014039828919575, 0.014135155449061411, 0.04034617895060916, 0.057630575489280585, 0.03796178393906856, 0.012637541642049447, -0.015014039828919575, -0.04160737907596747, -0.0641838159733434, -0.08056977983257328, -0.08956773031925042, -0.09097419633026813, -0.08545030284658549, -0.07429153508625874, -0.05915252370129161, -0.04177969822725026, -0.023792531570818704, -0.006536976075760194, 0.008983020970559483, 0.022104754680741474, 0.03245520841273295, 0.03987122267808871, 0.04431326426819208, 0.04579094280463962, 0.04431326426819208, 0.03987122267808871, 0.03245520841273295, 0.022104754680741474, 0.008983020970559483, -0.006536976075760194, -0.023792531570818704, -0.04177969822725026, -0.05915252370129161, -0.07429153508625874, -0.08545030284658549, -0.09097419633026813, -0.08956773031925042, -0.08056977983257328, -0.0641838159733434, -0.04160737907596747, -0.015014039828919575, 0.012637541642049447, 0.03796178393906856, 0.057630575489280585, 0.06825111305414358, 0.05682630444012635, 0.03796178393906856, 0.014135155449061411, -0.011763804124600832, -0.036874869103929196, -0.05874532782785397, -0.0755937821931744, -0.08643675803630407, -0.09108220848970375, -0.09001568643529065, -0.08421802680997838, -0.07495689987901655, -0.06358975846704862, -0.051405153532472825, -0.039516385641518936, -0.028809016621975873, -0.019934067090364063, -0.013332838992708288, -0.009277249905099167, -0.007910644259137822, -0.009277249905099167, -0.013332838992708288, -0.019934067090364063, -0.028809016621975873, -0.039516385641518936, -0.051405153532472825, -0.06358975846704862, -0.07495689987901655, -0.08421802680997838, -0.09001568643529065, -0.09108220848970375, -0.08643675803630407, -0.0755937821931744, -0.05874532782785397, -0.036874869103929196, -0.011763804124600832, 0.014135155449061411, 0.03796178393906856, 0.05682630444012635, 0.06825111305414358, 0.07070980527467927, 0.06825111305414358, 0.057630575489280585, 0.04034617895060916, 0.018552192423288767, -0.005305751788096055, -0.028845244812144625, -0.05003852305222089, -0.06740715089491094, -0.08010823579141367, -0.08792034505189632, -0.09115188436397047, -0.09050228958928583, -0.08690699622242735, -0.08139217990463421, -0.07495689987901655, -0.06849088196757172, -0.06272773781166564, -0.05822723495837525, -0.05537684587809335, -0.054402111088936986, -0.05537684587809335, -0.05822723495837525, -0.06272773781166564, -0.06849088196757172, -0.07495689987901655, -0.08139217990463421, -0.08690699622242735, -0.09050228958928583, -0.09115188436397047, -0.08792034505189632, -0.08010823579141367, -0.06740715089491094, -0.05003852305222089, -0.028845244812144625, -0.005305751788096055, 0.018552192423288767, 0.04034617895060916, 0.057630575489280585, 0.06825111305414358, 0.07070980527467927]
In [21]:
plot = Nyaplot::Plot3D.new
plot.add(:wireframe, x, y, z)
plot.show
Out[21]:
In [22]:
plot = Nyaplot::Plot.new
plot.add(:bar, ['Persian', 'Maine Coon', 'American Shorthair'], [10,20,30])
plot.x_label("Species")
plot.y_label("Number")
plot.show
Out[22]:
In [23]:
x = []; y = []; theta = 0.6; a=1
while theta < 14*Math::PI do
  x.push(a*Math::cos(theta)/theta)
  y.push(a*Math::sin(theta)/theta)
  theta += 0.1
end
plot1 = Nyaplot::Plot.new
plot1.add(:line, x, y)
plot1.show
Out[23]:
In [24]: