Class: GnuPlot

Inherits:
Object
  • Object
show all
Defined in:
lib/gnuplotty/GnuPlot-Class.rb

Constant Summary collapse

@@commandstring =
''

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(command, options = '') ⇒ GnuPlot

Returns a new instance of GnuPlot.



10
11
12
13
# File 'lib/gnuplotty/GnuPlot-Class.rb', line 10

def initialize(command,options='')
  @command=command
  @options=options
end

Class Method Details

.commandstringObject



25
26
27
# File 'lib/gnuplotty/GnuPlot-Class.rb', line 25

def self.commandstring
  @@commandstring
end

.commandstring_resetObject



29
30
31
# File 'lib/gnuplotty/GnuPlot-Class.rb', line 29

def self.commandstring_reset
  @@commandstring=''
end

.showObject



21
22
23
# File 'lib/gnuplotty/GnuPlot-Class.rb', line 21

def self.show
 `gnuplot -persist -e \"#{@@commandstring}\"`
end

Instance Method Details

#addObject



15
16
17
18
19
# File 'lib/gnuplotty/GnuPlot-Class.rb', line 15

def add 
  c=@command+' '+@options
  @@commandstring=@@commandstring+"; " unless @@commandstring==''
  @@commandstring=@@commandstring+c
end