1
1
module GnuplotRB
2
2
##
3
3
# === Overview
4
- # Plot correspond to simple 2D visualisation
4
+ # Class corresponding to simple 2D visualisation.
5
+ #
6
+ # === Notebooks
7
+ #
8
+ # * {Heatmaps}[http://nbviewer.ipython.org/github/dilcom/gnuplotrb/blob/master/notebooks/heatmaps.ipynb]
9
+ # * {Vector field}[http://nbviewer.ipython.org/github/dilcom/gnuplotrb/blob/master/notebooks/vector_field.ipynb]
10
+ # * {Math equations}[http://nbviewer.ipython.org/github/dilcom/gnuplotrb/blob/master/notebooks/math_plots.ipynb]
11
+ # * {Histogram}[http://nbviewer.ipython.org/github/dilcom/gnuplotrb/blob/master/notebooks/histogram.ipynb]
12
+ # * {Updating plots with new data}[http://nbviewer.ipython.org/github/dilcom/gnuplotrb/blob/master/notebooks/updating_data.ipynb]
13
+ #
14
+ # === Options
15
+ # All possible options are exaplained in
16
+ # {gnuplot docs}[http://www.gnuplot.info/docs_5.0/gnuplot.pdf](pp. 105-190).
17
+ # Several common ones:
18
+ # * xrange(yrange, zrange, urange, vrange) - set range for a variable. Takes
19
+ # Range (xrange: 0..100), or String (yrange: '[0:100]').
20
+ # * title - plot's title. Takes String (title: 'Some new plot').
21
+ # * polar (parametric) - plot in polar or parametric space. Takes boolean (true).
22
+ # * using - choose which columns of input data gnuplot should use. Takes String
23
+ # (using: 'xtic(1):2:3'). If Daru::Dataframe passed one can use column names
24
+ # instead of numbers (using: 'index:value1:summ' - value1 and summ here are column names).
25
+ # * style_data - set style for plotting data. Takes string, possible values: histogram,
26
+ # points, lines, linespoints, boxes etc. See gnuplot docs for more.
27
+ # * term - select terminal used by gnuplot. Examples: { term: 'png' },
28
+ # { term: ['svg', size: [600, 600]] }. Deprecated due to existance of #to_<term_name> methods.
29
+ # One can use #to_png and #to_svg(size: [600, 600]) instead of passing previous options.
30
+ # * output - select filename to output plot to. Should be used together with term. Deprecated
31
+ # due to existance of #to_<term_name> methods. One should use #to_png('file.png') instead of
32
+ # passing { term: 'png', output: 'file.png' }.
33
+ # Every option may be passed to constructor in order to create plot with it.
34
+ # Methods #options(several: options, ...) and bunch of #option_name(only_an: option) such as
35
+ # #xrange, #using, #polar etc create new Plot object based on existing but with a new options.
36
+ # See notebooks for examples.
5
37
class Plot
6
38
include Plottable
7
39
##
@@ -13,7 +45,7 @@ class Plot
13
45
# [data, **dataset_options] arrays from which Dataset may be created
14
46
# * *options* will be considered as 'settable' options of gnuplot
15
47
# ('set xrange [1:10]' for { xrange: 1..10 },
16
- # "set title 'plot'" for { title: 'plot' } etc)
48
+ # "set title 'plot'" for { title: 'plot' } etc).
17
49
def initialize ( *datasets )
18
50
# had to relace **options arg with this because in some cases
19
51
# Daru::DataFrame was mentioned as hash and added to options
@@ -33,7 +65,7 @@ def initialize(*datasets)
33
65
# ====== Overview
34
66
# This outputs plot to term (if given) or to this plot's own terminal.
35
67
# ====== Arguments
36
- # * *term* - Terminal to plot to
68
+ # * *term* - Terminal object to plot to
37
69
# * *multiplot_part* - part of a multiplot. Option for inner usage
38
70
# * *options* - will be considered as 'settable' options of gnuplot
39
71
# ('set xrange [1:10]', 'set title 'plot'' etc)
0 commit comments