gnutemplate 0.1.7 → 0.1.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6eee2e328cf1aa0e13b0f9feb52243010ba7a1eb189e4399b20502c401badee5
4
- data.tar.gz: 4ddcbec7e5e1e461780d3a29367bd32d974a116c4cfa23c145c9b7ecf14a8bee
3
+ metadata.gz: c69189fd4dac115b797679a47830cbc77c3c66d593f611ee5192159d331f6bbb
4
+ data.tar.gz: 77dcfea02ef16af3f38d256802f3cdd583b81bb5cf14ad11f2dc07badf7edec6
5
5
  SHA512:
6
- metadata.gz: c06b4a8c302745e0f9e4d2f66febd917a470650f175ecd3f28927681c48b9f5106c65f12b60069fc11f78191757fc42c0c69c9a3a712b40cca3cdfa53b0c8bbc
7
- data.tar.gz: 1bb991e26f74a599caefce50169a1ec1ba6b9864bd27614f64f548c4105814921928da6321608e88e6fda574e50674d76e1ea949f2ddeaf6742f21ff877f8455
6
+ metadata.gz: 3ebcfa577e172cf2562a5111842ca926248fad462516b7fd6a1c7aaa847a7308b3c2f71fdfa05acf8c043cc55eea4808c04208b283cbfcc76e8fb464d7711733
7
+ data.tar.gz: 308aca33a72e7900c1195d088529f16a84d7fcd44edbc191a68977a5125ff266e0d3de51a5ad83290572b6d67db4f4f5945a9ac6bd55d71cdfd56dcb92dd6333
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Gnutemplate
4
- VERSION = "0.1.7"
4
+ VERSION = "0.1.8"
5
5
  end
data/lib/gnutemplate.rb CHANGED
@@ -186,9 +186,17 @@ module Gnutemplate
186
186
  .gsub(/,$/, ")")
187
187
  set xtics: xtics
188
188
 
189
- plot [*freqs[0], using: 2, w: :histogram, t: labels[0], fillcolor: "rgb \"#{colors[0 % 4]}\""],
190
- [*freqs[1], using: 2, w: :histogram, t: labels[1], fillcolor: "rgb \"#{colors[1 % 4]}\""],
191
- [*freqs[2], using: 2, w: :histogram, t: labels[2], fillcolor: "rgb \"#{colors[2 % 4]}\""]
189
+ labels ||= (0...(freqs.length)).map(&:to_s)
190
+
191
+ args = freqs.zip(labels).each_with_index.map do |(f, l), i|
192
+ [*f, using: 2, :histogram, t: labels[i], fillcolor: "rgb \"#{colors[0 % 4]}\""]
193
+ end
194
+
195
+ plot *args
196
+ #plot [*freqs[0], using: 2, w: :histogram, t: labels[0], fillcolor: "rgb \"#{colors[0 % 4]}\""],
197
+ #[*freqs[1], using: 2, w: :histogram, t: labels[1], fillcolor: "rgb \"#{colors[1 % 4]}\""],
198
+ #[*freqs[2], using: 2, w: :histogram, t: labels[2], fillcolor: "rgb \"#{colors[2 % 4]}\""]
199
+
192
200
  end # Of if pileup..else
193
201
  end # Of Numo.noteplot do
194
202
 
@@ -267,9 +275,18 @@ module Gnutemplate
267
275
  .gsub(/,$/, ")")
268
276
  set xtics: xtics
269
277
 
270
- plot [*freqs[0], using: 2, w: :histogram, t: labels[0], fillcolor: "rgb \"#{colors[0 % 4]}\""],
271
- [*freqs[1], using: 2, w: :histogram, t: labels[1], fillcolor: "rgb \"#{colors[1 % 4]}\""],
272
- [*freqs[2], using: 2, w: :histogram, t: labels[2], fillcolor: "rgb \"#{colors[2 % 4]}\""]
278
+ labels ||= (0...(freqs.length)).map(&:to_s)
279
+
280
+ args = freqs.zip(labels).each_with_index.map do |(f, l), i|
281
+ [*f, using: 2, :histogram, t: labels[i], fillcolor: "rgb \"#{colors[0 % 4]}\""]
282
+ end
283
+
284
+ plot *args
285
+
286
+ #plot [*freqs[0], using: 2, w: :histogram, t: labels[0], fillcolor: "rgb \"#{colors[0 % 4]}\""],
287
+ #[*freqs[1], using: 2, w: :histogram, t: labels[1], fillcolor: "rgb \"#{colors[1 % 4]}\""],
288
+ #[*freqs[2], using: 2, w: :histogram, t: labels[2], fillcolor: "rgb \"#{colors[2 % 4]}\""]
289
+
273
290
  end # Of if pileup..else
274
291
  end # Of Numo.noteplot do
275
292
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gnutemplate
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7
4
+ version: 0.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - showata
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-10-10 00:00:00.000000000 Z
11
+ date: 2023-10-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: numo-gnuplot
@@ -38,7 +38,7 @@ dependencies:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
- description: Templates of boxplot, histgram, etc.
41
+ description: Templates of boxplot, histogram, etc.
42
42
  email:
43
43
  - shun_yamaguchi_tc@live.jp
44
44
  executables: []