gnuplotty 0.0.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 +7 -0
- data/lib/gnuplotty/GnuPlot-Class.rb +55 -0
- data/lib/gnuplotty.rb +12 -0
- metadata +48 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: aa8d6283c8c1bf44ec3c10a8f0498d45f9c9cbf6
|
4
|
+
data.tar.gz: ed9fb05f9a5116522624c26a9cf31ca0b9dfeded
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 29bace784b39c97db1291154a1e9ba6916a8878d661b51b5b7f50ca17641359e3fbebdd6707130300b3c9ff1d1c8ebb17be3bf0359d7397906b783b9ffbfc01c
|
7
|
+
data.tar.gz: c288bca1996a21055541f52a4969a03c87e2305c6a59a26c6d23bc98c7d5288d71e07e5c36bb77bf18cc8561017e1484ceef5b9ff6e6235f372e27d677c517f7
|
@@ -0,0 +1,55 @@
|
|
1
|
+
'''
|
2
|
+
gnuplot commands are represented through objects of the GnuPlot class,
|
3
|
+
they are added to the commandstring with #add, which is executed by GnuPlot.show
|
4
|
+
'''
|
5
|
+
|
6
|
+
class GnuPlot
|
7
|
+
|
8
|
+
@@commandstring=''
|
9
|
+
|
10
|
+
def initialize(command,options='')
|
11
|
+
@command=command
|
12
|
+
@options=options
|
13
|
+
end
|
14
|
+
|
15
|
+
def add
|
16
|
+
c=@command+' '+@options
|
17
|
+
@@commandstring=@@commandstring+"; " unless @@commandstring==''
|
18
|
+
@@commandstring=@@commandstring+c
|
19
|
+
end
|
20
|
+
|
21
|
+
def self.show
|
22
|
+
`gnuplot -persist -e \"#{@@commandstring}\"`
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
|
27
|
+
|
28
|
+
|
29
|
+
__END__
|
30
|
+
|
31
|
+
#Example:
|
32
|
+
|
33
|
+
The file p.csv has five lines:
|
34
|
+
0,0,0
|
35
|
+
1,1,1
|
36
|
+
2,4,9
|
37
|
+
3,9,27
|
38
|
+
4,16,64
|
39
|
+
|
40
|
+
|
41
|
+
csv=GnuPlot.new("set datafile separator","','")
|
42
|
+
terminal=GnuPlot.new("set terminal","'#{GnuPlotDefaults::TERMINAL}'")
|
43
|
+
linestyle1=GnuPlot.new("set style","line 1 lt 1 lw 2 lc rgb 'green' ps 0")
|
44
|
+
linestyle2=GnuPlot.new("set style","line 2 lt 1 lw 2 lc rgb 'red' ps 0")
|
45
|
+
plot=GnuPlot.new("plot"," 'p.csv' using 1:2 with linespoints ls 1 title 'Graph 1', 'p.csv' using 1:3 with linespoints ls 2 notitle ")
|
46
|
+
|
47
|
+
csv.add
|
48
|
+
terminal.add
|
49
|
+
linestyle1.add
|
50
|
+
linestyle2.add
|
51
|
+
plot.add
|
52
|
+
|
53
|
+
GnuPlot.show
|
54
|
+
|
55
|
+
|
data/lib/gnuplotty.rb
ADDED
metadata
ADDED
@@ -0,0 +1,48 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: gnuplotty
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.2
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Jogan Thums
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2019-09-22 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
13
|
+
description: |-
|
14
|
+
gnuplot commands are represented through objects of the GnuPlot class,
|
15
|
+
they are added with #add to the commandstring, which is executed by GnuPlot.show
|
16
|
+
email:
|
17
|
+
- skopeo@gmx.net
|
18
|
+
executables: []
|
19
|
+
extensions: []
|
20
|
+
extra_rdoc_files: []
|
21
|
+
files:
|
22
|
+
- lib/gnuplotty.rb
|
23
|
+
- lib/gnuplotty/GnuPlot-Class.rb
|
24
|
+
homepage: http://rubygems.org/gems/gnuplotty
|
25
|
+
licenses:
|
26
|
+
- MIT
|
27
|
+
metadata: {}
|
28
|
+
post_install_message:
|
29
|
+
rdoc_options: []
|
30
|
+
require_paths:
|
31
|
+
- lib
|
32
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
33
|
+
requirements:
|
34
|
+
- - ">="
|
35
|
+
- !ruby/object:Gem::Version
|
36
|
+
version: '0'
|
37
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
38
|
+
requirements:
|
39
|
+
- - ">="
|
40
|
+
- !ruby/object:Gem::Version
|
41
|
+
version: '0'
|
42
|
+
requirements: []
|
43
|
+
rubyforge_project:
|
44
|
+
rubygems_version: 2.6.12
|
45
|
+
signing_key:
|
46
|
+
specification_version: 4
|
47
|
+
summary: Simple ruby wrapper for gnuplot
|
48
|
+
test_files: []
|