gnuplotrb 0.3.1 → 0.3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +4 -4
- data/LICENSE +20 -20
- data/README.rdoc +163 -163
- data/Rakefile +16 -16
- data/gnuplotrb.gemspec +30 -30
- data/lib/gnuplotrb.rb +35 -35
- data/lib/gnuplotrb/animation.rb +129 -129
- data/lib/gnuplotrb/external_classes/array.rb +17 -17
- data/lib/gnuplotrb/external_classes/daru.rb +43 -43
- data/lib/gnuplotrb/external_classes/string.rb +6 -6
- data/lib/gnuplotrb/fit.rb +204 -204
- data/lib/gnuplotrb/mixins/error_handling.rb +48 -48
- data/lib/gnuplotrb/mixins/option_handling.rb +190 -190
- data/lib/gnuplotrb/mixins/plottable.rb +208 -208
- data/lib/gnuplotrb/multiplot.rb +269 -269
- data/lib/gnuplotrb/plot.rb +299 -299
- data/lib/gnuplotrb/splot.rb +18 -18
- data/lib/gnuplotrb/staff/datablock.rb +112 -112
- data/lib/gnuplotrb/staff/dataset.rb +294 -294
- data/lib/gnuplotrb/staff/settings.rb +89 -80
- data/lib/gnuplotrb/staff/terminal.rb +202 -202
- data/lib/gnuplotrb/version.rb +8 -8
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a11967424a768d934b06d8dfbf5d2566cd64c6de
|
4
|
+
data.tar.gz: 3431a5548027a08e34c493e6d6902dd31a4c183f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0159809835bc50598a811ea1e0959da7f9a6829c376b8c41aece0d5b7df543a30dc27fdfdd097e8b663d89a6e54ee74dd156dbd28b2ae5907c4fbb8d61d3b1fc
|
7
|
+
data.tar.gz: 754af035c5a5ae9e861b2a72f41b25e4ccec476b169cb683fd2614074903a2a5874bef1ced500129a7f73869f267686567b7fe97c9f20dee02e34636906ac256
|
data/Gemfile
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
source 'https://rubygems.org'
|
2
|
-
|
3
|
-
# Specify your gem's dependencies in gnuplotrb.gemspec
|
4
|
-
gemspec
|
1
|
+
source 'https://rubygems.org'
|
2
|
+
|
3
|
+
# Specify your gem's dependencies in gnuplotrb.gemspec
|
4
|
+
gemspec
|
data/LICENSE
CHANGED
@@ -1,21 +1,21 @@
|
|
1
|
-
The MIT License (MIT)
|
2
|
-
|
3
|
-
Copyright (c) 2015 Ivan Evgrafov
|
4
|
-
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
7
|
-
in the Software without restriction, including without limitation the rights
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
10
|
-
furnished to do so, subject to the following conditions:
|
11
|
-
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
13
|
-
copies or substantial portions of the Software.
|
14
|
-
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2015 Ivan Evgrafov
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
21
|
SOFTWARE.
|
data/README.rdoc
CHANGED
@@ -1,163 +1,163 @@
|
|
1
|
-
= GnuplotRB
|
2
|
-
|
3
|
-
GnuplotRB is a plot generator for Ruby based on {Gnuplot}[http://www.gnuplot.info].
|
4
|
-
|
5
|
-
This software has been developed as a product in Google Summer of Code 2015 (GSoC2015). Its progress may be saw in {SciRuby mailing list}[https://groups.google.com/forum/?fromgroups#!topic/sciruby-dev/lhWvb5hWc3k] or in {project's blog}[http://www.evgrafov.work/gnuplotrb/].
|
6
|
-
|
7
|
-
{<img src="https://badge.fury.io/rb/gnuplotrb.svg" alt="Gem Version" />}[https://rubygems.org/gems/gnuplotrb]
|
8
|
-
|
9
|
-
{<img src="https://gemnasium.com/dilcom/gnuplotrb.svg" alt="Dependency Status" />}[https://gemnasium.com/dilcom/gnuplotrb]
|
10
|
-
|
11
|
-
{<img src="https://travis-ci.org/
|
12
|
-
{<img src="https://codeclimate.com/github/
|
13
|
-
{<img src="https://codeclimate.com/github/
|
14
|
-
|
15
|
-
== Table of contents
|
16
|
-
* {Installation}[https://github.com/
|
17
|
-
* {Getting started}[https://github.com/
|
18
|
-
* {Plottable classes}[https://github.com/
|
19
|
-
* {Notebooks}[https://github.com/
|
20
|
-
* {Plain examples}[https://github.com/
|
21
|
-
* {Contributing}[https://github.com/
|
22
|
-
|
23
|
-
== Installation
|
24
|
-
=== Dependencies
|
25
|
-
* Ruby 2.0+
|
26
|
-
* It is required to install {gnuplot 5.0}[http://www.gnuplot.info/download.html] to use that gem.
|
27
|
-
=== Gem installation
|
28
|
-
==== Install latest stable version from Rubygems
|
29
|
-
gem install gnuplotrb
|
30
|
-
==== Install latest stable version using bundler
|
31
|
-
* add
|
32
|
-
gem 'gnuplotrb'
|
33
|
-
to your Gemfile
|
34
|
-
* run
|
35
|
-
bundle install
|
36
|
-
==== Install latest version from source (may be unstable)
|
37
|
-
git clone https://github.com/
|
38
|
-
cd gnuplotrb
|
39
|
-
bundle install
|
40
|
-
rake install
|
41
|
-
|
42
|
-
== Getting started
|
43
|
-
|
44
|
-
GnuplotRB gem is based on {Gnuplot}[http://www.gnuplot.info/] so I would recommend to use {Gnuplot doc}[http://www.gnuplot.info/docs_5.0/gnuplot.pdf] and {GnuplotRB doc at Rubydoc}[https://rubygems.org/gems/gnuplotrb] in cases when docs and examples (as notebooks and plain examples) present here are not enough to explain how to plot something.
|
45
|
-
|
46
|
-
=== Plottable classes
|
47
|
-
|
48
|
-
Each of plottable classes may be outputted to image file using ```#to_png```, ```#to_svg```, ```#to_gif``` and so on methods. You can read more about it in {GnuplotRB doc}[https://rubygems.org/gems/gnuplotrb] related to Plottable module or see examples in {beginners notebook}[http://nbviewer.ipython.org/github/
|
49
|
-
|
50
|
-
==== Dataset
|
51
|
-
Single dataset may be created with math formula ('sin(x)') or some data. If your data is stored in a file you can just pass a filename (e.g. 'gnuplotrb.data'). Dataset may also be constructed out of data contained in Ruby classes (Array, Daru containers), see {example notebooks}[https://github.com/
|
52
|
-
|
53
|
-
Dataset have several possible options which are explained in {gnuplot doc}[http://www.gnuplot.info/docs_5.0/gnuplot.pdf] (pp. 80-102). Options are passed to Dataset.new as hash and are tranlated into gnuplot format before plotting:
|
54
|
-
Dataset.new(data, with: 'lines', using: '1:2')
|
55
|
-
Examples of option translation (nested containers allowed):
|
56
|
-
* Hash:
|
57
|
-
{ key1: "value1", key2: { nested_key1: "nested_value1" } }
|
58
|
-
# =>
|
59
|
-
"key1 value1 key2 nested key1 nested_value1"
|
60
|
-
* Hashes with underscored keys (see {#7}[https://github.com/dilcom/gnuplotrb/issues/7]):
|
61
|
-
{ style_data: 'histograms' }
|
62
|
-
#=>
|
63
|
-
"style data histograms"
|
64
|
-
* Range:
|
65
|
-
{ xrange: 0..100 }
|
66
|
-
# =>
|
67
|
-
"xrange [0:100]"
|
68
|
-
* Array (often used with nested hashes) and Array of Numeric
|
69
|
-
['png', { size: [400, 500] }]
|
70
|
-
# =>
|
71
|
-
"png size 400,500"
|
72
|
-
* Others
|
73
|
-
some_object
|
74
|
-
# =>
|
75
|
-
some_object.to_s
|
76
|
-
|
77
|
-
Once Dataset created, it may be updated with new data or options. Methods related to updating are explained in {a notebook}[http://nbviewer.ipython.org/github/
|
78
|
-
|
79
|
-
Just as other Plottable object Dataset has several plotting methods which are desribed in {beginners notebook}[http://nbviewer.ipython.org/github/
|
80
|
-
|
81
|
-
==== Plot
|
82
|
-
Plot is a container for several datasets and layout options:
|
83
|
-
Plot.new(ds1, ds2, ds2, xrange: 1..10)
|
84
|
-
|
85
|
-
Datasets contained bu Plot are outputted on single xy plain.
|
86
|
-
|
87
|
-
Plot's options are explained in {gnuplot doc}[http://www.gnuplot.info/docs_5.0/gnuplot.pdf] (pp. 105-181). Plot options are translated into gnuplot format the same way as Dataset's (except adding 'set' before each option). Plot's datasets and Plot itself may be updated with almost the same methods as desribed in Dataset section above.
|
88
|
-
|
89
|
-
==== Splot
|
90
|
-
Almost the same as Plot but for 3-D plots. See Plot section.
|
91
|
-
|
92
|
-
==== Multiplot
|
93
|
-
|
94
|
-
Container for several Plot or Splot objects, each of them is plotted in its own xy(z) space. So Multiplot offers single layout (image file\window) for several plots. It's grid is tuned by :layout option, and you can also set layout's title:
|
95
|
-
Multiplot.new(plot1, plot2, splot1, layout: [3, 1], title: 'Three plots on a layout')
|
96
|
-
|
97
|
-
Updating methods for Multiplot are almost the same as Plot's and Dataset's and are covered in Multiplot's docs and {multiplot notebook}[http://nbviewer.ipython.org/github/
|
98
|
-
|
99
|
-
==== Animation
|
100
|
-
|
101
|
-
Animation is a container for several Plot, Splot or Multiplot objects. Each of contained items is considered as frame in gif animation which is creating by ```#plot``` call. Animation's frames and options may be modifyed or updated just as other classes above. Animation does not support methods like ```#to_png``` and may be plotted only with ```#plot``` method. Please see {related notebook}[http://nbviewer.ipython.org/github/
|
102
|
-
|
103
|
-
=== Notebooks
|
104
|
-
|
105
|
-
This notebooks are powered by {Ruby kernel}[https://github.com/SciRuby/iruby/] for {IPython/Jupyter}[https://jupyter.org/].
|
106
|
-
I placed them here to show some GnuplotRB's capabilities and ways of using it together with iRuby.
|
107
|
-
|
108
|
-
To use GnuplotRB gem with iRuby you need to install them both.
|
109
|
-
|
110
|
-
* iRuby installation is covered in its {README}[https://github.com/SciRuby/iruby/blob/master/README.md].
|
111
|
-
It also covers installation of iPython and other dependecies.
|
112
|
-
* GnuplotRB gem installation covered in {README}[https://github.com/
|
113
|
-
|
114
|
-
==== Embedding plots into iRuby
|
115
|
-
Using GnuplotRB inside iRuby notebooks is covered in:
|
116
|
-
|
117
|
-
* {Basic usage notebook}[http://nbviewer.ipython.org/github/
|
118
|
-
|
119
|
-
==== 2D and 3D plots
|
120
|
-
GnuplotRB is capable to plot vast range of plots from histograms to 3D heatmaps. Gem's repository contains examples of several plot types:
|
121
|
-
|
122
|
-
* {Heatmaps}[http://nbviewer.ipython.org/github/
|
123
|
-
* {Vector field}[http://nbviewer.ipython.org/github/
|
124
|
-
* {Math equations}[http://nbviewer.ipython.org/github/
|
125
|
-
* {3D visualizations}[http://nbviewer.ipython.org/github/
|
126
|
-
* {Histogram}[http://nbviewer.ipython.org/github/
|
127
|
-
|
128
|
-
==== Possible datasources
|
129
|
-
GnuplotRB may take data in Ruby container or in a file. Supported containers for now are Arrays, Daru::Vector and Daru::DataFrame.
|
130
|
-
When data given in file, GnuplotRB pass filename to Gnuplot *without* reading the file into memory.
|
131
|
-
|
132
|
-
Examples of using different datasources:
|
133
|
-
|
134
|
-
* {Data given in file or Ruby Array}[http://nbviewer.ipython.org/github/
|
135
|
-
* {Data given in Daru containers}[http://nbviewer.ipython.org/github/
|
136
|
-
* {Data given in Daru containers (with timeseries)}[http://nbviewer.ipython.org/github/
|
137
|
-
* {Updating plots with new data}[http://nbviewer.ipython.org/github/
|
138
|
-
|
139
|
-
==== Multiplot
|
140
|
-
You can not only plot several datasets in single coordinate system but place several coordinate systems on a canvas.
|
141
|
-
|
142
|
-
* {Multiplot example notebook}[http://nbviewer.ipython.org/github/
|
143
|
-
|
144
|
-
==== Animation
|
145
|
-
It's possible to use several plots (Plot, Splot or Multiplot objects) to create gif animation.
|
146
|
-
|
147
|
-
* {Animation example notebook}[http://nbviewer.ipython.org/github/
|
148
|
-
|
149
|
-
==== Fitting data with formula
|
150
|
-
GnuplotRB also may be used to fit some data with given math formula.
|
151
|
-
|
152
|
-
* {Fitting data}[http://nbviewer.ipython.org/github/
|
153
|
-
|
154
|
-
=== Plain examples
|
155
|
-
You may find several examples in {examples directory}[https://github.com/
|
156
|
-
|
157
|
-
== Contributing
|
158
|
-
|
159
|
-
1. {Fork repository}[https://github.com/
|
160
|
-
2. Create your feature branch (`git checkout -b my-new-feature`)
|
161
|
-
3. Commit your changes (`git commit -am 'Add some feature'`)
|
162
|
-
4. Push to the branch (`git push origin my-new-feature`)
|
163
|
-
5. Create a new Pull Request
|
1
|
+
= GnuplotRB
|
2
|
+
|
3
|
+
GnuplotRB is a plot generator for Ruby based on {Gnuplot}[http://www.gnuplot.info].
|
4
|
+
|
5
|
+
This software has been developed as a product in Google Summer of Code 2015 (GSoC2015). Its progress may be saw in {SciRuby mailing list}[https://groups.google.com/forum/?fromgroups#!topic/sciruby-dev/lhWvb5hWc3k] or in {project's blog}[http://www.evgrafov.work/gnuplotrb/].
|
6
|
+
|
7
|
+
{<img src="https://badge.fury.io/rb/gnuplotrb.svg" alt="Gem Version" />}[https://rubygems.org/gems/gnuplotrb]
|
8
|
+
|
9
|
+
{<img src="https://gemnasium.com/dilcom/gnuplotrb.svg" alt="Dependency Status" />}[https://gemnasium.com/dilcom/gnuplotrb]
|
10
|
+
|
11
|
+
{<img src="https://travis-ci.org/SciRuby/gnuplotrb.svg" alt="Build Status" />}[https://travis-ci.org/SciRuby/gnuplotrb]
|
12
|
+
{<img src="https://codeclimate.com/github/sciruby/gnuplotrb/badges/gpa.svg" alt="Code quality" />}[https://codeclimate.com/github/sciruby/gnuplotrb]
|
13
|
+
{<img src="https://codeclimate.com/github/sciruby/gnuplotrb/badges/coverage.svg" alt="Test coverage" />}[https://codeclimate.com/github/sciruby/gnuplotrb]
|
14
|
+
|
15
|
+
== Table of contents
|
16
|
+
* {Installation}[https://github.com/sciruby/gnuplotrb#installation]
|
17
|
+
* {Getting started}[https://github.com/sciruby/gnuplotrb#getting-started]
|
18
|
+
* {Plottable classes}[https://github.com/sciruby/gnuplotrb#plottable-classes]
|
19
|
+
* {Notebooks}[https://github.com/sciruby/gnuplotrb#notebooks]
|
20
|
+
* {Plain examples}[https://github.com/sciruby/gnuplotrb#plain-examples]
|
21
|
+
* {Contributing}[https://github.com/sciruby/gnuplotrb#contributing]
|
22
|
+
|
23
|
+
== Installation
|
24
|
+
=== Dependencies
|
25
|
+
* Ruby 2.0+
|
26
|
+
* It is required to install {gnuplot 5.0}[http://www.gnuplot.info/download.html] to use that gem.
|
27
|
+
=== Gem installation
|
28
|
+
==== Install latest stable version from Rubygems
|
29
|
+
gem install gnuplotrb
|
30
|
+
==== Install latest stable version using bundler
|
31
|
+
* add
|
32
|
+
gem 'gnuplotrb'
|
33
|
+
to your Gemfile
|
34
|
+
* run
|
35
|
+
bundle install
|
36
|
+
==== Install latest version from source (may be unstable)
|
37
|
+
git clone https://github.com/sciruby/gnuplotrb.git
|
38
|
+
cd gnuplotrb
|
39
|
+
bundle install
|
40
|
+
rake install
|
41
|
+
|
42
|
+
== Getting started
|
43
|
+
|
44
|
+
GnuplotRB gem is based on {Gnuplot}[http://www.gnuplot.info/] so I would recommend to use {Gnuplot doc}[http://www.gnuplot.info/docs_5.0/gnuplot.pdf] and {GnuplotRB doc at Rubydoc}[https://rubygems.org/gems/gnuplotrb] in cases when docs and examples (as notebooks and plain examples) present here are not enough to explain how to plot something.
|
45
|
+
|
46
|
+
=== Plottable classes
|
47
|
+
|
48
|
+
Each of plottable classes may be outputted to image file using ```#to_png```, ```#to_svg```, ```#to_gif``` and so on methods. You can read more about it in {GnuplotRB doc}[https://rubygems.org/gems/gnuplotrb] related to Plottable module or see examples in {beginners notebook}[http://nbviewer.ipython.org/github/sciruby/gnuplotrb/blob/master/notebooks/basic_usage.ipynb].
|
49
|
+
|
50
|
+
==== Dataset
|
51
|
+
Single dataset may be created with math formula ('sin(x)') or some data. If your data is stored in a file you can just pass a filename (e.g. 'gnuplotrb.data'). Dataset may also be constructed out of data contained in Ruby classes (Array, Daru containers), see {example notebooks}[https://github.com/sciruby/gnuplotrb#possible-datasources].
|
52
|
+
|
53
|
+
Dataset have several possible options which are explained in {gnuplot doc}[http://www.gnuplot.info/docs_5.0/gnuplot.pdf] (pp. 80-102). Options are passed to Dataset.new as hash and are tranlated into gnuplot format before plotting:
|
54
|
+
Dataset.new(data, with: 'lines', using: '1:2')
|
55
|
+
Examples of option translation (nested containers allowed):
|
56
|
+
* Hash:
|
57
|
+
{ key1: "value1", key2: { nested_key1: "nested_value1" } }
|
58
|
+
# =>
|
59
|
+
"key1 value1 key2 nested key1 nested_value1"
|
60
|
+
* Hashes with underscored keys (see {#7}[https://github.com/dilcom/gnuplotrb/issues/7]):
|
61
|
+
{ style_data: 'histograms' }
|
62
|
+
#=>
|
63
|
+
"style data histograms"
|
64
|
+
* Range:
|
65
|
+
{ xrange: 0..100 }
|
66
|
+
# =>
|
67
|
+
"xrange [0:100]"
|
68
|
+
* Array (often used with nested hashes) and Array of Numeric
|
69
|
+
['png', { size: [400, 500] }]
|
70
|
+
# =>
|
71
|
+
"png size 400,500"
|
72
|
+
* Others
|
73
|
+
some_object
|
74
|
+
# =>
|
75
|
+
some_object.to_s
|
76
|
+
|
77
|
+
Once Dataset created, it may be updated with new data or options. Methods related to updating are explained in {a notebook}[http://nbviewer.ipython.org/github/sciruby/gnuplotrb/blob/master/notebooks/updating_data.ipynb].
|
78
|
+
|
79
|
+
Just as other Plottable object Dataset has several plotting methods which are desribed in {beginners notebook}[http://nbviewer.ipython.org/github/sciruby/gnuplotrb/blob/master/notebooks/basic_usage.ipynb].
|
80
|
+
|
81
|
+
==== Plot
|
82
|
+
Plot is a container for several datasets and layout options:
|
83
|
+
Plot.new(ds1, ds2, ds2, xrange: 1..10)
|
84
|
+
|
85
|
+
Datasets contained bu Plot are outputted on single xy plain.
|
86
|
+
|
87
|
+
Plot's options are explained in {gnuplot doc}[http://www.gnuplot.info/docs_5.0/gnuplot.pdf] (pp. 105-181). Plot options are translated into gnuplot format the same way as Dataset's (except adding 'set' before each option). Plot's datasets and Plot itself may be updated with almost the same methods as desribed in Dataset section above.
|
88
|
+
|
89
|
+
==== Splot
|
90
|
+
Almost the same as Plot but for 3-D plots. See Plot section.
|
91
|
+
|
92
|
+
==== Multiplot
|
93
|
+
|
94
|
+
Container for several Plot or Splot objects, each of them is plotted in its own xy(z) space. So Multiplot offers single layout (image file\window) for several plots. It's grid is tuned by :layout option, and you can also set layout's title:
|
95
|
+
Multiplot.new(plot1, plot2, splot1, layout: [3, 1], title: 'Three plots on a layout')
|
96
|
+
|
97
|
+
Updating methods for Multiplot are almost the same as Plot's and Dataset's and are covered in Multiplot's docs and {multiplot notebook}[http://nbviewer.ipython.org/github/sciruby/gnuplotrb/blob/master/notebooks/multiplot_layout.ipynb]. See examples there.
|
98
|
+
|
99
|
+
==== Animation
|
100
|
+
|
101
|
+
Animation is a container for several Plot, Splot or Multiplot objects. Each of contained items is considered as frame in gif animation which is creating by ```#plot``` call. Animation's frames and options may be modifyed or updated just as other classes above. Animation does not support methods like ```#to_png``` and may be plotted only with ```#plot``` method. Please see {related notebook}[http://nbviewer.ipython.org/github/sciruby/gnuplotrb/blob/master/notebooks/animated_plots.ipynb] and docs at RubyDoc for examples.
|
102
|
+
|
103
|
+
=== Notebooks
|
104
|
+
|
105
|
+
This notebooks are powered by {Ruby kernel}[https://github.com/SciRuby/iruby/] for {IPython/Jupyter}[https://jupyter.org/].
|
106
|
+
I placed them here to show some GnuplotRB's capabilities and ways of using it together with iRuby.
|
107
|
+
|
108
|
+
To use GnuplotRB gem with iRuby you need to install them both.
|
109
|
+
|
110
|
+
* iRuby installation is covered in its {README}[https://github.com/SciRuby/iruby/blob/master/README.md].
|
111
|
+
It also covers installation of iPython and other dependecies.
|
112
|
+
* GnuplotRB gem installation covered in {README}[https://github.com/sciruby/gnuplotrb#installation] too.
|
113
|
+
|
114
|
+
==== Embedding plots into iRuby
|
115
|
+
Using GnuplotRB inside iRuby notebooks is covered in:
|
116
|
+
|
117
|
+
* {Basic usage notebook}[http://nbviewer.ipython.org/github/sciruby/gnuplotrb/blob/master/notebooks/basic_usage.ipynb].
|
118
|
+
|
119
|
+
==== 2D and 3D plots
|
120
|
+
GnuplotRB is capable to plot vast range of plots from histograms to 3D heatmaps. Gem's repository contains examples of several plot types:
|
121
|
+
|
122
|
+
* {Heatmaps}[http://nbviewer.ipython.org/github/sciruby/gnuplotrb/blob/master/notebooks/heatmaps.ipynb]
|
123
|
+
* {Vector field}[http://nbviewer.ipython.org/github/sciruby/gnuplotrb/blob/master/notebooks/vector_field.ipynb] (Thanks, {Alexej}[https://github.com/agisga])
|
124
|
+
* {Math equations}[http://nbviewer.ipython.org/github/sciruby/gnuplotrb/blob/master/notebooks/math_plots.ipynb]
|
125
|
+
* {3D visualizations}[http://nbviewer.ipython.org/github/sciruby/gnuplotrb/blob/master/notebooks/3d_plot.ipynb]
|
126
|
+
* {Histogram}[http://nbviewer.ipython.org/github/sciruby/gnuplotrb/blob/master/notebooks/histogram.ipynb]
|
127
|
+
|
128
|
+
==== Possible datasources
|
129
|
+
GnuplotRB may take data in Ruby container or in a file. Supported containers for now are Arrays, Daru::Vector and Daru::DataFrame.
|
130
|
+
When data given in file, GnuplotRB pass filename to Gnuplot *without* reading the file into memory.
|
131
|
+
|
132
|
+
Examples of using different datasources:
|
133
|
+
|
134
|
+
* {Data given in file or Ruby Array}[http://nbviewer.ipython.org/github/sciruby/gnuplotrb/blob/master/notebooks/points_from_different_sources.ipynb]
|
135
|
+
* {Data given in Daru containers}[http://nbviewer.ipython.org/github/sciruby/gnuplotrb/blob/master/notebooks/plotting_from_daru.ipynb]
|
136
|
+
* {Data given in Daru containers (with timeseries)}[http://nbviewer.ipython.org/github/sciruby/gnuplotrb/blob/master/notebooks/time_series_from_daru.ipynb]
|
137
|
+
* {Updating plots with new data}[http://nbviewer.ipython.org/github/sciruby/gnuplotrb/blob/master/notebooks/updating_data.ipynb]
|
138
|
+
|
139
|
+
==== Multiplot
|
140
|
+
You can not only plot several datasets in single coordinate system but place several coordinate systems on a canvas.
|
141
|
+
|
142
|
+
* {Multiplot example notebook}[http://nbviewer.ipython.org/github/sciruby/gnuplotrb/blob/master/notebooks/multiplot_layout.ipynb].
|
143
|
+
|
144
|
+
==== Animation
|
145
|
+
It's possible to use several plots (Plot, Splot or Multiplot objects) to create gif animation.
|
146
|
+
|
147
|
+
* {Animation example notebook}[http://nbviewer.ipython.org/github/sciruby/gnuplotrb/blob/master/notebooks/animated_plots.ipynb].
|
148
|
+
|
149
|
+
==== Fitting data with formula
|
150
|
+
GnuplotRB also may be used to fit some data with given math formula.
|
151
|
+
|
152
|
+
* {Fitting data}[http://nbviewer.ipython.org/github/sciruby/gnuplotrb/blob/master/notebooks/fitting_data.ipynb]
|
153
|
+
|
154
|
+
=== Plain examples
|
155
|
+
You may find several examples in {examples directory}[https://github.com/sciruby/gnuplotrb/tree/master/examples].
|
156
|
+
|
157
|
+
== Contributing
|
158
|
+
|
159
|
+
1. {Fork repository}[https://github.com/sciruby/gnuplotrb/fork]
|
160
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
161
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
162
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
163
|
+
5. Create a new Pull Request
|
data/Rakefile
CHANGED
@@ -1,16 +1,16 @@
|
|
1
|
-
require 'bundler/gem_tasks'
|
2
|
-
require 'rspec/core/rake_task'
|
3
|
-
require 'rspec/core'
|
4
|
-
require 'yard'
|
5
|
-
require 'rubocop/rake_task'
|
6
|
-
|
7
|
-
RSpec::Core::RakeTask.new(:spec) do |spec|
|
8
|
-
spec.pattern = FileList['spec/**/*_spec.rb'].uniq
|
9
|
-
spec.rspec_opts = '--format documentation'
|
10
|
-
end
|
11
|
-
|
12
|
-
YARD::Rake::YardocTask.new(:doc) do |t|
|
13
|
-
t.files = %w(README.rdoc lib) # optional
|
14
|
-
end
|
15
|
-
|
16
|
-
RuboCop::RakeTask.new(:cop)
|
1
|
+
require 'bundler/gem_tasks'
|
2
|
+
require 'rspec/core/rake_task'
|
3
|
+
require 'rspec/core'
|
4
|
+
require 'yard'
|
5
|
+
require 'rubocop/rake_task'
|
6
|
+
|
7
|
+
RSpec::Core::RakeTask.new(:spec) do |spec|
|
8
|
+
spec.pattern = FileList['spec/**/*_spec.rb'].uniq
|
9
|
+
spec.rspec_opts = '--format documentation'
|
10
|
+
end
|
11
|
+
|
12
|
+
YARD::Rake::YardocTask.new(:doc) do |t|
|
13
|
+
t.files = %w(README.rdoc lib) # optional
|
14
|
+
end
|
15
|
+
|
16
|
+
RuboCop::RakeTask.new(:cop)
|
data/gnuplotrb.gemspec
CHANGED
@@ -1,30 +1,30 @@
|
|
1
|
-
# coding: utf-8
|
2
|
-
lib = File.expand_path('../lib', __FILE__)
|
3
|
-
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
-
require 'gnuplotrb/version'
|
5
|
-
|
6
|
-
Gem::Specification.new do |spec|
|
7
|
-
spec.name = 'gnuplotrb'
|
8
|
-
spec.version = GnuplotRB::VERSION
|
9
|
-
spec.authors = ['Ivan Evgrafov']
|
10
|
-
spec.email = ['dilcom3107@gmail.com']
|
11
|
-
|
12
|
-
spec.summary = 'Ruby bindings for gnuplot'
|
13
|
-
spec.description = 'Renewed ruby bindings for gnuplot. Started at GSoC 2015.'
|
14
|
-
spec.homepage = 'https://github.com/dilcom/gnuplotrb'
|
15
|
-
spec.license = 'MIT'
|
16
|
-
spec.required_ruby_version = '>= 2.0'
|
17
|
-
|
18
|
-
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(/^(test|spec|unimplemented_features|examples|future_work|notebooks|\..+)/) }
|
19
|
-
spec.require_paths = ['lib']
|
20
|
-
|
21
|
-
spec.add_runtime_dependency 'hamster', '~> 1.0'
|
22
|
-
spec.add_development_dependency 'bundler', '~> 1.7'
|
23
|
-
spec.add_development_dependency 'rake', '~> 10.0'
|
24
|
-
spec.add_development_dependency 'rspec', '~> 3.2'
|
25
|
-
spec.add_development_dependency 'yard', '~> 0.8'
|
26
|
-
spec.add_development_dependency 'rubocop', '~> 0.29'
|
27
|
-
spec.add_development_dependency 'codeclimate-test-reporter'
|
28
|
-
spec.add_development_dependency 'chunky_png'
|
29
|
-
spec.add_development_dependency 'daru'
|
30
|
-
end
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'gnuplotrb/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = 'gnuplotrb'
|
8
|
+
spec.version = GnuplotRB::VERSION
|
9
|
+
spec.authors = ['Ivan Evgrafov']
|
10
|
+
spec.email = ['dilcom3107@gmail.com']
|
11
|
+
|
12
|
+
spec.summary = 'Ruby bindings for gnuplot'
|
13
|
+
spec.description = 'Renewed ruby bindings for gnuplot. Started at GSoC 2015.'
|
14
|
+
spec.homepage = 'https://github.com/dilcom/gnuplotrb'
|
15
|
+
spec.license = 'MIT'
|
16
|
+
spec.required_ruby_version = '>= 2.0'
|
17
|
+
|
18
|
+
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(/^(test|spec|unimplemented_features|examples|future_work|notebooks|\..+)/) }
|
19
|
+
spec.require_paths = ['lib']
|
20
|
+
|
21
|
+
spec.add_runtime_dependency 'hamster', '~> 1.0'
|
22
|
+
spec.add_development_dependency 'bundler', '~> 1.7'
|
23
|
+
spec.add_development_dependency 'rake', '~> 10.0'
|
24
|
+
spec.add_development_dependency 'rspec', '~> 3.2'
|
25
|
+
spec.add_development_dependency 'yard', '~> 0.8'
|
26
|
+
spec.add_development_dependency 'rubocop', '~> 0.29'
|
27
|
+
spec.add_development_dependency 'codeclimate-test-reporter'
|
28
|
+
spec.add_development_dependency 'chunky_png'
|
29
|
+
spec.add_development_dependency 'daru'
|
30
|
+
end
|