Class: Gnuplot::DataSet

### Home Classes Methods

### In Files

- lib/gnuplot.rb

### Parent

Object

### Methods

- ::new
- #notitle
- #plot_args
- #to_gplot
- #to_gsplot

### Files

- ChangeLog
- LICENSE.txt

### Class/Module Index

Quicksearch

- Gnuplot
- Gnuplot::DataSet
- Gnuplot::Plot
- Gnuplot::SPlot
- Array
- Matrix

No matching classes.

# Gnuplot::DataSet

Container for a single dataset 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.

`data` The data that will be plotted. The only requirement is that the object understands the to_gplot method.

The following attributes correspond to their related string in the gnuplot command. See the gnuplot documentation for more information on this.

    title, with

@todo Use the delegator to delegate to the data property.

### Attributes

axes[RW]
data[RW]
linecolor[RW]
linewidth[RW]
matrix[RW]
smooth[RW]
title[RW]
using[RW]
with[RW]

### Public Class Methods

new(data = nil) click to toggle source

    # File lib/gnuplot.rb, line 215
    def initialize (data = nil)
      @data = data
      @title = @with = @using = @linewidth = @linecolor = @matrix = @smooth = @axes = nil # avoid warnings
      yield self if block_given?
    end

### Public Instance Methods

notitle() click to toggle source

    # File lib/gnuplot.rb, line 221
    def notitle
      @title = "notitle"
    end

plot_args(io = "") click to toggle source

    # File lib/gnuplot.rb, line 225
    def plot_args (io = "")

      # Order of these is important or gnuplot barfs on 'em

      io << ( (@data.instance_of? String) ? @data : "'-'" )

      io << " using #{@using}" if @using

      io << " axes #{@axes}" if @axes

      io << case @title
            when /notitle/ then " notitle"
            when nil       then ""
            else " title '#{@title}'"
            end

      io << " matrix" if @matrix
      io << " smooth #{@smooth}" if @smooth
      io << " with #{@with}" if @with
      io << " linecolor #{@linecolor}" if @linecolor
      io << " linewidth #{@linewidth}" if @linewidth
      io
    end

to_gplot() click to toggle source

    # File lib/gnuplot.rb, line 249
    def to_gplot
      case @data
      when nil then nil
      when String then nil
      else @data.to_gplot
      end
    end

to_gsplot() click to toggle source

    # File lib/gnuplot.rb, line 257
    def to_gsplot
      case @data
      when nil then nil
      when String then nil
      else @data.to_gsplot
      end
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.