Class: Gnuplot::DataSet
- Inherits:
-
Object
- Object
- Gnuplot::DataSet
- Defined in:
- lib/gnuplot.rb
Overview
Container for a single data set being displayed by GNUPLOT. Each object has a reference to the actual data being plotted as well as settings that control the plot
command. The data object must support the to_gplot
command.
The other attributes correspond to their related string in the GNUPLOT command. See the GNUPLOT documentation for more information on this.
Instance Attribute Summary collapse
-
#axes ⇒ Object
Returns the value of attribute axes.
-
#data ⇒ Object
Returns the value of attribute data.
-
#linewidth ⇒ Object
Returns the value of attribute linewidth.
-
#matrix ⇒ Object
Returns the value of attribute matrix.
-
#smooth ⇒ Object
Returns the value of attribute smooth.
-
#title ⇒ Object
Returns the value of attribute title.
-
#using ⇒ Object
Returns the value of attribute using.
-
#with ⇒ Object
Returns the value of attribute with.
Instance Method Summary collapse
-
#initialize(data = nil) {|_self| ... } ⇒ DataSet
constructor
A new instance of DataSet.
-
#notitle ⇒ Object
Set no title.
-
#plot_args(io = '') ⇒ Object
Write the plot arguments to
io
. -
#to_gplot(io = '') ⇒ Object
Write the plot data to
io
. -
#to_gsplot(io = '') ⇒ Object
Write the splot data to
io
.
Constructor Details
#initialize(data = nil) {|_self| ... } ⇒ DataSet
Returns a new instance of DataSet.
223 224 225 226 |
# File 'lib/gnuplot.rb', line 223 def initialize(data = nil) @data = data yield self if block_given? end |
Instance Attribute Details
#axes ⇒ Object
Returns the value of attribute axes.
221 222 223 |
# File 'lib/gnuplot.rb', line 221 def axes @axes end |
#data ⇒ Object
Returns the value of attribute data.
221 222 223 |
# File 'lib/gnuplot.rb', line 221 def data @data end |
#linewidth ⇒ Object
Returns the value of attribute linewidth.
221 222 223 |
# File 'lib/gnuplot.rb', line 221 def linewidth @linewidth end |
#matrix ⇒ Object
Returns the value of attribute matrix.
221 222 223 |
# File 'lib/gnuplot.rb', line 221 def matrix @matrix end |
#smooth ⇒ Object
Returns the value of attribute smooth.
221 222 223 |
# File 'lib/gnuplot.rb', line 221 def smooth @smooth end |
#title ⇒ Object
Returns the value of attribute title.
221 222 223 |
# File 'lib/gnuplot.rb', line 221 def title @title end |
#using ⇒ Object
Returns the value of attribute using.
221 222 223 |
# File 'lib/gnuplot.rb', line 221 def using @using end |
#with ⇒ Object
Returns the value of attribute with.
221 222 223 |
# File 'lib/gnuplot.rb', line 221 def with @with end |
Instance Method Details
#notitle ⇒ Object
Set no title.
229 230 231 |
# File 'lib/gnuplot.rb', line 229 def notitle @title = 'notitle' end |
#plot_args(io = '') ⇒ Object
Write the plot arguments to io
.
234 235 236 237 238 239 240 241 |
# File 'lib/gnuplot.rb', line 234 def plot_args(io = '') # Order of these is important or GNUPLOT barfs on 'em %w[data using axes title matrix smooth with linewidth].each { |arg| plot_arg(io, arg) } io end |
#to_gplot(io = '') ⇒ Object
Write the plot data to io
.
244 245 246 |
# File 'lib/gnuplot.rb', line 244 def to_gplot(io = '') @data.to_gplot(io) if plot? end |
#to_gsplot(io = '') ⇒ Object
Write the splot data to io
.
249 250 251 |
# File 'lib/gnuplot.rb', line 249 def to_gsplot(io = '') @data.to_gsplot(io) if plot? end |