GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — gnuplotrb/examples/plot_histogram/plot.rb at master · SciRuby/gnuplotrb

Expand file tree

/

plot.rb

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
22 lines (20 loc) · 768 Bytes
/

plot.rb

Copy path

File metadata and controls

22 lines (20 loc) · 768 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
require 'gnuplotrb'
include GnuplotRB
titles = %w{decade Austria Hungary Belgium}
data = [
['1891-1900', 234081, 181288, 18167],
['1901-1910', 668209, 808511, 41635],
['1911-1920', 453649, 442693, 33746],
['1921-1930', 32868, 30680, 15846],
['1931-1940', 3563, 7861, 4817],
['1941-1950', 24860, 3469, 12189],
['1951-1960', 67106, 36637, 18575],
['1961-1970', 20621, 5401, 9192],
]
x = data.map(&:first)
datasets = (1..3).map do |col|
y = data.map { |row| row[col] }
Dataset.new([x, y], using: '2:xtic(1)', title: titles[col], file: true)
end
plot = Plot.new(*datasets, title: 'Histogram example', style: 'data histograms', xtics: 'nomirror rotate by -45')
plot.to_png('./gnuplot_gem.png', size: [600, 600])
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.