numo-gnuplot 0.2.1 → 0.2.2
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.
- checksums.yaml +4 -4
- data/.gitignore +2 -0
- data/README.md +16 -10
- data/ToDo +5 -0
- data/lib/numo/gnuplot.rb +6 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 29fcfeddd9306971c509ac8bb4e90be5417fa335
|
4
|
+
data.tar.gz: 8ea65134c96a1f03de4d8eb1daee35a9a1b473a5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 223e5cdb0624b897309615464fc6ce32c48b350fc0a08a85207a7cfb1cfd1c04b20c4346ce19891960b238a70bb56e28762a56a1a9155aaecf008b699959341b
|
7
|
+
data.tar.gz: 8107a5596ccd6462c2c867bafc816ae57e07852d53febf8b222366c5c0d4c97727dd93bb882484eea679ca68d0c4648e63bc4af54e28625cf09c54d8ea0ddab6
|
data/.gitignore
CHANGED
data/README.md
CHANGED
@@ -4,9 +4,9 @@ Alpha version under development.
|
|
4
4
|
|
5
5
|
* [GitHub site](https://github.com/ruby-numo/gnuplot)
|
6
6
|
* [RubyGems site](https://rubygems.org/gems/numo-gnuplot)
|
7
|
-
* [Demo repository](https://github.com/ruby-numo/numo-gnuplot-demo)
|
7
|
+
* [Demo repository](https://github.com/ruby-numo/numo-gnuplot-demo) contains > 500 plots!
|
8
8
|
|
9
|
-
* [API doc](http://www.rubydoc.info/gems/numo-gnuplot/Numo/Gnuplot)
|
9
|
+
* [API doc](http://www.rubydoc.info/gems/numo-gnuplot/0.2.1/Numo/Gnuplot)
|
10
10
|
* [Introduction.ja](https://github.com/ruby-numo/gnuplot/wiki/Introduction.ja) (in Japanese)
|
11
11
|
|
12
12
|
Although there are many [other Gnuplot interface libraries for Ruby](https://github.com/ruby-numo/gnuplot#related-work),
|
@@ -88,7 +88,7 @@ irb(gnuplot):002:0> set t:"Example Plot"
|
|
88
88
|
irb(gnuplot):003:0> plot "sin(x)",w:"lines"
|
89
89
|
```
|
90
90
|
|
91
|
-
* Plotting X-Y data.
|
91
|
+
* Plotting X-Y data stored in arrays.
|
92
92
|
|
93
93
|
```ruby
|
94
94
|
require "numo/gnuplot"
|
@@ -102,7 +102,7 @@ Numo.gnuplot do
|
|
102
102
|
end
|
103
103
|
```
|
104
104
|
|
105
|
-
* Plotting X-Y data in
|
105
|
+
* Plotting X-Y data stored in NArrays.
|
106
106
|
|
107
107
|
```ruby
|
108
108
|
require "numo/gnuplot"
|
@@ -129,12 +129,14 @@ x = Numo::DFloat[-n..n]/n*10
|
|
129
129
|
|
130
130
|
Numo.gnuplot do
|
131
131
|
set title:"multiple data series"
|
132
|
-
|
132
|
+
|
133
|
+
# Hash-separated form
|
133
134
|
plot x,NM.sin(x), {w:'points',t:'sin(x)'}, x,x*NM.sin(x),{w:"lines",t:'x*sin(x)'}
|
134
|
-
|
135
|
-
#
|
136
|
-
|
137
|
-
|
135
|
+
|
136
|
+
# or Array-separated form
|
137
|
+
plot [x,NM.sin(x), w:'points',t:'sin(x)'], [x,x*NM.sin(x),w:"lines",t:'x*sin(x)']
|
138
|
+
# (here last item in each Array should be Hash, to distinguish from data array)
|
139
|
+
|
138
140
|
end
|
139
141
|
```
|
140
142
|
|
@@ -218,10 +220,14 @@ See [API doc](http://www.rubydoc.info/gems/numo-gnuplot/Numo/Gnuplot) for more.
|
|
218
220
|
|
219
221
|
## Related Work
|
220
222
|
|
221
|
-
* [Ruby Gnuplot](https://github.com/rdp/ruby_gnuplot
|
223
|
+
* [Ruby Gnuplot](https://github.com/rdp/ruby_gnuplot)
|
224
|
+
* [ruby-plot](https://github.com/davor/ruby-plot)
|
225
|
+
* [Plotrobber](https://github.com/elitheeli/plotrobber)
|
222
226
|
* [GNUPlotr](https://github.com/pbosetti/gnuplotr)
|
223
227
|
* [GnuPlotter](https://github.com/maasha/gnuplotter)
|
228
|
+
* [scbi_plot](https://rubygems.org/gems/scbi_plot)
|
224
229
|
* [GnuplotRB](https://github.com/dilcom/gnuplotrb)
|
230
|
+
* [NumPlot](https://rubygems.org/gems/numplot)
|
225
231
|
|
226
232
|
## Contributing
|
227
233
|
|
data/ToDo
CHANGED
data/lib/numo/gnuplot.rb
CHANGED
@@ -18,7 +18,7 @@ module Numo
|
|
18
18
|
|
19
19
|
class Gnuplot
|
20
20
|
|
21
|
-
VERSION = "0.2.
|
21
|
+
VERSION = "0.2.2"
|
22
22
|
POOL = []
|
23
23
|
DATA_FORMAT = "%.7g"
|
24
24
|
|
@@ -37,12 +37,12 @@ class Gnuplot
|
|
37
37
|
|
38
38
|
def to_iruby
|
39
39
|
require 'tempfile'
|
40
|
-
tempfile_svg = Tempfile.open('plot')
|
40
|
+
tempfile_svg = Tempfile.open(['plot','.svg'])
|
41
41
|
# output SVG to tmpfile
|
42
42
|
gp = Gnuplot.default
|
43
43
|
gp.reset
|
44
44
|
gp.set terminal:'svg'
|
45
|
-
gp.output:tempfile_svg.path
|
45
|
+
gp.set output:tempfile_svg.path
|
46
46
|
gp.instance_eval(&@block)
|
47
47
|
gp.unset 'output'
|
48
48
|
svg = File.read(tempfile_svg.path)
|
@@ -290,6 +290,9 @@ class Gnuplot
|
|
290
290
|
def run(s,data=nil)
|
291
291
|
res = send_cmd(s,data)
|
292
292
|
if !res.empty?
|
293
|
+
if /.*?End\sof\sanimation\ssequence.*?/im =~ res.to_s
|
294
|
+
return nil
|
295
|
+
end
|
293
296
|
if res.size < 7
|
294
297
|
if res.all?{|x| /^\s*(line \d+: )?warning:/i =~ x}
|
295
298
|
$stderr.puts res.join.strip
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: numo-gnuplot
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Masahiro TANAKA
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-02-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|