unifiedPlot 0.0.4 → 0.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (4) hide show
  1. data/gemspec +1 -1
  2. data/lib/unifiedPlot.rb +11 -3
  3. metadata +10 -8
  4. checksums.yaml +0 -7
data/gemspec CHANGED
@@ -2,7 +2,7 @@ require 'rubygems'
2
2
 
3
3
  GEM_SPEC = Gem::Specification.new do |s|
4
4
  s.name = "unifiedPlot"
5
- s.version = '0.0.4'
5
+ s.version = '0.0.5'
6
6
  s.date = Time.new.strftime("%Y-%m-%d")
7
7
 
8
8
  s.description = 'single interface to line-plotting data in [],NArray and GSL::Vector format'
data/lib/unifiedPlot.rb CHANGED
@@ -1,4 +1,5 @@
1
1
  require 'gnuplot'
2
+ require 'gsl'
2
3
  require 'rubypython'
3
4
  require 'fileutils'
4
5
 
@@ -35,7 +36,7 @@ module UnifiedPlot
35
36
  # :title => '',
36
37
  # :grid => false,
37
38
  # }
38
- def UnifiedPlot.linePlot(inputs, plotConf: PLOT_DEFAULTS, title: '', oType: 'x11',oName: 'test')
39
+ def UnifiedPlot.linePlot(inputs, plotConf =PLOT_DEFAULTS, title ='', oType ='x11',oName ='test')
39
40
  # allow hash input
40
41
  inputs = [inputs] if inputs.kind_of? Hash
41
42
 
@@ -71,7 +72,7 @@ module UnifiedPlot
71
72
  end
72
73
  return ('x11' != oType) ? [oName,oType].join('.') : nil
73
74
  end
74
- def UnifiedPlot.pm3d(inputs,plotConf: PLOT_DEFAULTS,title: '',oType: 'x11',oName: 'test')
75
+ def UnifiedPlot.pm3d(inputs,plotConf = PLOT_DEFAULTS,title = '',oType = 'x11',oName = 'test')
75
76
  Gnuplot.open do |gp|
76
77
  Gnuplot::SPlot.new( gp ) do |plot|
77
78
  unless 'x11' == oType
@@ -105,7 +106,7 @@ module UnifiedPlot
105
106
  end
106
107
  return ('x11' != oType) ? [oName,oType].join('.') : nil
107
108
  end
108
- def UnifiedPlot.heatMap(inputs,plotConf: PLOT_DEFAULTS,title: '',oType: 'x11',oName: 'test')
109
+ def UnifiedPlot.heatMap(inputs,plotConf = PLOT_DEFAULTS,title = '',oType = 'x11',oName = 'test')
109
110
  plotConf = PLOT_DEFAULTS.merge(plotConf)
110
111
  Gnuplot.open do |gp|
111
112
  Gnuplot::Plot.new( gp ) do |plot|
@@ -135,6 +136,13 @@ module UnifiedPlot
135
136
  end
136
137
  return ('x11' != oType) ? [oName,oType].join('.') : nil
137
138
  end
139
+ def UnifiedPlot.histogram(inputs)
140
+ nbins = 100
141
+ max = inputs[:y].abs.max
142
+ h = GSL::Histogram.alloc(nbins, [-max, max])
143
+ h.fill(inputs[:y])
144
+ GSL::graph(h)
145
+ end
138
146
  def UnifiedPlot.fieldPlot(inputs)
139
147
  RubyPython.start
140
148
  pl = RubyPython.import('pylab')
metadata CHANGED
@@ -1,14 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: unifiedPlot
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
+ prerelease:
5
6
  platform: ruby
6
7
  authors:
7
8
  - Ralf Mueller
8
9
  autorequire:
9
10
  bindir: bin
10
11
  cert_chain: []
11
- date: 2014-06-19 00:00:00.000000000 Z
12
+ date: 2016-01-21 00:00:00.000000000 Z
12
13
  dependencies: []
13
14
  description: single interface to line-plotting data in [],NArray and GSL::Vector format
14
15
  email: stark.dreamdetective@gmail.com
@@ -16,30 +17,31 @@ executables: []
16
17
  extensions: []
17
18
  extra_rdoc_files: []
18
19
  files:
19
- - gemspec
20
20
  - lib/unifiedPlot.rb
21
+ - gemspec
21
22
  homepage: https://github.com/Try2Code/unifiedPlot
22
23
  licenses:
23
24
  - BSD
24
- metadata: {}
25
25
  post_install_message:
26
26
  rdoc_options: []
27
27
  require_paths:
28
28
  - lib
29
29
  required_ruby_version: !ruby/object:Gem::Requirement
30
+ none: false
30
31
  requirements:
31
- - - ">="
32
+ - - ! '>='
32
33
  - !ruby/object:Gem::Version
33
34
  version: '0'
34
35
  required_rubygems_version: !ruby/object:Gem::Requirement
36
+ none: false
35
37
  requirements:
36
- - - ">="
38
+ - - ! '>='
37
39
  - !ruby/object:Gem::Version
38
40
  version: '0'
39
41
  requirements: []
40
42
  rubyforge_project:
41
- rubygems_version: 2.2.2
43
+ rubygems_version: 1.8.23.2
42
44
  signing_key:
43
- specification_version: 4
45
+ specification_version: 3
44
46
  summary: simple line plot for array-based inputs
45
47
  test_files: []
checksums.yaml DELETED
@@ -1,7 +0,0 @@
1
- ---
2
- SHA1:
3
- metadata.gz: 304311035a530de07e6cafc0ec9ceadacb004fe9
4
- data.tar.gz: ec01987014080b3bcb05ad1e0256c5f503975c21
5
- SHA512:
6
- metadata.gz: 0bdbb5432b3d625b72aee36a41043aa3840e6890a38bdd0c772f9e373a6f556f4307d216086c6d5dd5523fa280e1b174ee09c8b2029b41bd4da6bbd10ef57a4c
7
- data.tar.gz: cb08346500cfbddf704a9bb79889833c0c8d4317d4b09991d57a74a8002f25606195094350a1817c7ade4ef3a0cb0ad33bb3437f45c3e8dbd9cddc6a66375e67