Class: Matrix

### Home Classes Methods

### In Files

- lib/gnuplot.rb

### Parent

Object

### Methods

- #to_gplot

### Files

- ChangeLog
- LICENSE.txt

### Class/Module Index

Quicksearch

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

No matching classes.

# Matrix

### Public Instance Methods

to_gplot(x = nil, y = nil) click to toggle source

    # File lib/gnuplot.rb, line 307
    def to_gplot (x = nil, y = nil)
      xgrid = x || (0...self.column_size).to_a
      ygrid = y || (0...self.row_size).to_a

      f = ""
      ygrid.length.times do |j|
        y = ygrid[j]
        xgrid.length.times do |i|
          if ( self[j,i] ) then
            f << "#{xgrid[i]} #{y} #{self[j,i]}\n"
          end
        end
      end

      f
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.