numo-gnuplot 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +4 -0
- data/lib/numo/gnuplot.rb +19 -2
- 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: 4e865eb2bf31c1edbd04ceddc258b75df8aab368
|
4
|
+
data.tar.gz: ee119b110229d70d890b908b568aaa785fda9fbd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c31f7b733ecaa2a41cbb650338657177e781d2a42653c951999f3c2ef2f4d933eeecfe1f244369b764d183e937072687fee4a3c22ea28933dda993c3ee72a64a
|
7
|
+
data.tar.gz: 4d2b967320a263878a2db1d263bdb19cb9cdc440a2b67d72e36f127705ba69218bdab5205b3ec0ee0a9093c6bfea6ca5ffdaf288f636ed7a1ff8e297e3df3c0f
|
data/README.md
CHANGED
data/lib/numo/gnuplot.rb
CHANGED
@@ -11,7 +11,7 @@ module Numo
|
|
11
11
|
|
12
12
|
class Gnuplot
|
13
13
|
|
14
|
-
VERSION = "0.1.
|
14
|
+
VERSION = "0.1.1"
|
15
15
|
POOL = []
|
16
16
|
DATA_FORMAT = "%.5g"
|
17
17
|
|
@@ -159,7 +159,7 @@ class Gnuplot
|
|
159
159
|
# The `refresh` reformats and redraws the current plot using the
|
160
160
|
# data already read in.
|
161
161
|
def refresh
|
162
|
-
send_cmd "
|
162
|
+
send_cmd "refresh"
|
163
163
|
nil
|
164
164
|
end
|
165
165
|
|
@@ -172,6 +172,23 @@ class Gnuplot
|
|
172
172
|
res
|
173
173
|
end
|
174
174
|
|
175
|
+
KNOWN_EXT = {"ps"=>"postscript","jpg"=>"jpeg"}
|
176
|
+
|
177
|
+
# output current plot to file with terminal setting from extension
|
178
|
+
# (not Gnuplot command)
|
179
|
+
def output(filename,*opts)
|
180
|
+
if /\.(\w+)$/ =~ filename
|
181
|
+
ext = $1
|
182
|
+
ext = KNOWN_EXT[ext]||ext
|
183
|
+
set terminal:[ext,*opts], output:filename
|
184
|
+
refresh
|
185
|
+
unset :terminal, :output
|
186
|
+
else
|
187
|
+
kernel_raise GnuplotError,"file extension is not given"
|
188
|
+
end
|
189
|
+
end
|
190
|
+
|
191
|
+
|
175
192
|
# turn on debug
|
176
193
|
def debug_on
|
177
194
|
@debug = true
|
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.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Masahiro TANAKA
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-05-
|
11
|
+
date: 2016-05-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|