File tree Expand file tree Collapse file tree 8 files changed +22
-10
lines changed Expand file tree Collapse file tree 8 files changed +22
-10
lines changed Original file line number Diff line number Diff line change 2
2
# Methods to take data for GnuplotRB plots.
3
3
class Array
4
4
# taken for example from current gnuplot bindings
5
+ # @return [String] array converted to Gnuplot format
5
6
def to_gnuplot_points
6
7
return '' if self . empty?
7
8
case self [ 0 ]
Original file line number Diff line number Diff line change @@ -6,6 +6,10 @@ module Daru
6
6
##
7
7
# Methods to take data for GnuplotRB plots.
8
8
class DataFrame
9
+ ##
10
+ # Convert DataFrame to Gnuplot format.
11
+ #
12
+ # @return [String] data converted to Gnuplot format
9
13
def to_gnuplot_points
10
14
result = ''
11
15
each_row_with_index do |row , index |
@@ -21,6 +25,10 @@ def to_gnuplot_points
21
25
##
22
26
# Methods to take data for GnuplotRB plots.
23
27
class Vector
28
+ ##
29
+ # Convert Vector to Gnuplot format.
30
+ #
31
+ # @return [String] data converted to Gnuplot format
24
32
def to_gnuplot_points
25
33
result = ''
26
34
each_with_index do |value , index |
Original file line number Diff line number Diff line change 1
1
##
2
2
# Methods to take data for GnuplotRB plots.
3
3
class String
4
- def to_gnuplot_points
5
- clone
6
- end
4
+ # @return [String] data converted to Gnuplot format
5
+ alias_method :to_gnuplot_points , :clone
7
6
end
Original file line number Diff line number Diff line change @@ -3,8 +3,8 @@ module GnuplotRB
3
3
# Contains methods relating to Gnuplot's fit function. Covered in
4
4
# {fit notebook}[http://nbviewer.ipython.org/github/dilcom/gnuplotrb/blob/master/notebooks/fitting_data.ipynb].
5
5
#
6
- # You can also see original gnuplot's fit in gnuplot
7
- # doc - http://www.gnuplot.info/docs_5.0/gnuplot.pdf p. 122.
6
+ # You can also see original gnuplot's fit in
7
+ # {gnuplot doc}[ http://www.gnuplot.info/docs_5.0/gnuplot.pdf] p. 122.
8
8
module Fit
9
9
##
10
10
# Fit given data with function.
@@ -19,9 +19,9 @@ module Fit
19
19
# @param :term_options [Hash] terminal options that should be setted to terminal before fit.
20
20
# You can see them in Plot's documentation (or even better in gnuplot doc)
21
21
# Most useful here are ranges (xrange, yrange etc) and fit option which tunes fit parameters
22
- # (see gnuplot doc - http://www.gnuplot.info/docs_5.0/gnuplot.pdf p. 122)
22
+ # (see { gnuplot doc}[ http://www.gnuplot.info/docs_5.0/gnuplot.pdf] p. 122)
23
23
# @param options [Hash] options passed to Gnuplot's fit such as *using*. They are covered in
24
- # gnuplot doc - http://www.gnuplot.info/docs_5.0/gnuplot.pdf (pp. 69-74)
24
+ # { gnuplot doc}[ http://www.gnuplot.info/docs_5.0/gnuplot.pdf] (pp. 69-74)
25
25
#
26
26
# @return [Hash] hash with four elements:
27
27
# - :formula_ds - dataset with best fit curve as data
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ module GnuplotRB
6
6
#
7
7
# == Options
8
8
# Dataset options are explained in
9
- # {gnuplot docs}[http://www.gnuplot.info/docs_5.0/gnuplot.pdf](pp. 80-101).
9
+ # {gnuplot docs}[http://www.gnuplot.info/docs_5.0/gnuplot.pdf] (pp. 80-101).
10
10
# Several common options:
11
11
# * with - set plot style for dataset ('lines', 'points', 'impulses' etc)
12
12
# * using - choose which columns of input data gnuplot should use. Takes String
Original file line number Diff line number Diff line change @@ -2,6 +2,8 @@ module GnuplotRB
2
2
##
3
3
# This module takes care of path to gnuplot executable and checking its version.
4
4
module Settings
5
+ ##
6
+ # GnuplotRB can work with Gnuplot 5.0+
5
7
MIN_GNUPLOT_VERSION = 5.0
6
8
7
9
class << self
Original file line number Diff line number Diff line change @@ -81,7 +81,7 @@ def store_datablock(data)
81
81
##
82
82
# Convert given options to gnuplot format.
83
83
#
84
- # For { opt1: val1, .. , optN: valN} it returns
84
+ # For "{ opt1: val1, .. , optN: valN }" it returns
85
85
# set opt1 val1
86
86
# ..
87
87
# set optN valN
@@ -103,7 +103,7 @@ def options_hash_to_string(options)
103
103
##
104
104
# Applie given options to current gnuplot instance.
105
105
#
106
- # For { opt1: val1, .. , optN: valN} it will output to gnuplot
106
+ # For "{ opt1: val1, .. , optN: valN }" it will output to gnuplot
107
107
# set opt1 val1
108
108
# ..
109
109
# set optN valN
Original file line number Diff line number Diff line change 2
2
# === Overview
3
3
# Ruby bindings for gnuplot.
4
4
module GnuplotRB
5
+ ##
6
+ # Gem version
5
7
VERSION = '0.3.0'
6
8
end
You can’t perform that action at this time.
0 commit comments