~ubuntu-branches/ubuntu/raring/ruby-gnuplot/raring

« back to all changes in this revision

Viewing changes to .pc/fix-tests.patch/examples/histogram.rb

  • Committer: Package Import Robot
  • Author(s): Cédric Boutillier
  • Date: 2012-06-11 00:09:08 UTC
  • mfrom: (2.1.1 sid)
  • Revision ID: package-import@ubuntu.com-20120611000908-027329i4h6spiar3
Tags: 2.4.1-1
* New upstream version 
* Add myself to Uploaders:
* Bump Standards-Version to 3.9.3 (no changes needed)
* Update copyright to DEP-5 copyright-format/1.0
* Refresh fix-tests.patch
* Clean examples/sine_wave.gif generated from tests
* Override lintian warning about duplicate description of transitional
  packages
* Set priority of transitional packages to extra
* Replace Conflicts: by Breaks: for relation with transitional packages

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
$LOAD_PATH.unshift(File.expand_path('../../lib', __FILE__))
 
2
require "gnuplot"
 
3
Gnuplot.open do |gp|
 
4
  Gnuplot::Plot.new(gp) do |plot|
 
5
  
 
6
    plot.title  "Histogram example"
 
7
    plot.style  "data histograms"
 
8
    plot.xtics  "nomirror rotate by -45"
 
9
    
 
10
    titles = %w{decade Austria Hungary  Belgium} 
 
11
    data = [
 
12
      ["1891-1900",  234081,  181288,  18167],    
 
13
      ["1901-1910",  668209,  808511,  41635],   
 
14
      ["1911-1920",  453649,  442693,  33746],   
 
15
      ["1921-1930",  32868,   30680,   15846],    
 
16
      ["1931-1940",  3563,    7861,    4817],     
 
17
      ["1941-1950",  24860,   3469,    12189],   
 
18
      ["1951-1960",  67106,   36637,   18575],  
 
19
      ["1961-1970",  20621,   5401,    9192],
 
20
    ]
 
21
    
 
22
    x = data.collect{|arr| arr.first}
 
23
    (1..3).each do |col|  
 
24
      y = data.collect{|arr| arr[col]}
 
25
      plot.data << Gnuplot::DataSet.new( [x, y] ) do |ds|
 
26
        ds.using = "2:xtic(1)"
 
27
        ds.title = titles[col]
 
28
      end
 
29
    end
 
30
  
 
31
  end
 
32
end
 
 
b'\\ No newline at end of file'