You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
GnuplotRB gem is based on [Gnuplot](http://www.gnuplot.info/) so I would
50
-
recommend to use [Gnuplot doc](http://www.gnuplot.info/docs_5.0/gnuplot.pdf)
51
-
and [GnuplotRB doc at Rubydoc](https://rubygems.org/gems/gnuplotrb) in cases
52
-
when docs and examples (as notebooks and plain examples) present here are not
53
-
enough to explain how to plot something.
46
+
## Getting started
47
+
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.
54
48
55
49
### Plottable classes
56
-
57
-
Each of plottable classes may be outputted to image file using ```#to_png```,
58
-
```#to_svg```, ```#to_gif``` and so on methods. You can read more about it in
59
-
[GnuplotRB doc](https://rubygems.org/gems/gnuplotrb) related to Plottable
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
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).
70
55
71
56
Dataset have several possible options which are explained in [gnuplot
72
-
doc](http://www.gnuplot.info/docs_5.0/gnuplot.pdf) (pp. 80-102). Options are
73
-
passed to Dataset.new as hash and are tranlated into gnuplot format before
74
-
plotting:
75
-
Dataset.new(data, with: 'lines', using: '1:2')
57
+
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:
58
+
59
+
```ruby
60
+
Dataset.new(data, with:'lines', using:'1:2')
61
+
```
76
62
77
63
Examples of option translation (nested containers allowed):
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).
96
+
97
+
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).
114
98
115
99
#### Plot
116
100
Plot is a container for several datasets and layout options:
117
-
Plot.new(ds1, ds2, ds2, xrange: 1..10)
101
+
```ruby
102
+
Plot.new(ds1, ds2, ds2, xrange:1..10)
103
+
```
118
104
119
105
Datasets contained bu Plot are outputted on single xy plain.
are translated into gnuplot format the same way as Dataset's (except adding
124
-
'set' before each option). Plot's datasets and Plot itself may be updated with
125
-
almost the same methods as desribed in Dataset section above.
107
+
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.
126
108
127
109
#### Splot
128
110
Almost the same as Plot but for 3-D plots. See Plot section.
129
111
130
112
#### Multiplot
131
113
132
-
Container for several Plot or Splot objects, each of them is plotted in its
133
-
own xy(z) space. So Multiplot offers single layout (image filewindow) for
134
-
several plots. It's grid is tuned by :layout option, and you can also set
135
-
layout's title:
136
-
Multiplot.new(plot1, plot2, splot1, layout: [3, 1], title: 'Three plots on a layout')
114
+
Container for several Plot or Splot objects, each of them is plotted in its own xy(z) space. So Multiplot offers single layout (image filewindow) for several plots. It's grid is tuned by :layout option, and you can also set layout's title:
115
+
```ruby
116
+
Multiplot.new(plot1, plot2, splot1, layout: [3, 1], title:'Three plots on a layout')
117
+
```
137
118
138
-
Updating methods for Multiplot are almost the same as Plot's and Dataset's and
ebooks/multiplot_layout.ipynb). See examples there.
119
+
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.
142
120
143
121
#### Animation
144
122
145
-
Animation is a container for several Plot, Splot or Multiplot objects. Each of
146
-
contained items is considered as frame in gif animation which is creating by
147
-
```#plot``` call. Animation's frames and options may be modifyed or updated
148
-
just as other classes above. Animation does not support methods like
149
-
```#to_png``` and may be plotted only with ```#plot``` method. Please see
ebooks/animated_plots.ipynb) and docs at RubyDoc for examples.
123
+
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.
153
124
154
125
### Notebooks
155
126
156
-
This notebooks are powered by [Ruby kernel](https://github.com/SciRuby/iruby/)
157
-
for [IPython/Jupyter](https://jupyter.org/). I placed them here to show some
158
-
GnuplotRB's capabilities and ways of using it together with iRuby.
127
+
This notebooks are powered by [Ruby kernel](https://github.com/SciRuby/iruby/) for [IPython/Jupyter](https://jupyter.org/). I placed them here to show some GnuplotRB's capabilities and ways of using it together with iRuby.
159
128
160
129
To use GnuplotRB gem with iRuby you need to install them both.
161
130
162
-
* iRuby installation is covered in its
163
-
[README](https://github.com/SciRuby/iruby/blob/master/README.md). It also
164
-
covers installation of iPython and other dependecies.
* iRuby installation is covered in its [README](https://github.com/SciRuby/iruby/blob/master/README.md). It also covers installation of iPython and other dependecies.
132
+
* GnuplotRB gem installation covered in [README](https://github.com/sciruby/gnuplotrb#installation) too.
167
133
168
134
169
135
#### Embedding plots into iRuby
170
136
Using GnuplotRB inside iRuby notebooks is covered in:
*[Data given in file or Ruby Array](http://nbviewer.ipython.org/github/sciruby/gnuplotrb/blob/master/notebooks/points_from_different_sources.ipynb)
159
+
*[Data given in Daru containers](http://nbviewer.ipython.org/github/sciruby/gnuplotrb/blob/master/notebooks/plotting_from_daru.ipynb)
160
+
*[Data given in Daru containers (with timeseries)](http://nbviewer.ipython.org/github/sciruby/gnuplotrb/blob/master/notebooks/time_series_from_daru.ipynb)
161
+
*[Updating plots with new data](http://nbviewer.ipython.org/github/sciruby/gnuplotrb/blob/master/notebooks/updating_data.ipynb)
215
162
216
163
217
164
#### Multiplot
218
165
You can not only plot several datasets in single coordinate system but place
0 commit comments