Method: Plot::PlotUtils.gnuplot

Defined in:
lib/redshift/util/plot.rb

.gnuplot(app = nil, &bl) ⇒ Object

Yields and returns the Plot instance. On unix/linux, the returned plot instance can no longer be used to send more plot commands, since it is just a copy of the real plot instance which is in a child process. On windows, be sure not to exit immediately after calling this method, or else tempfiles will be deleted before gnuplot has had a chance to read them.



284
285
286
287
288
289
290
291
# File 'lib/redshift/util/plot.rb', line 284

def gnuplot(app=nil, &bl)
  begin
    gnuplot_fork(app, &bl)
  rescue NotImplementedError => ex
    raise unless ex.message =~ /fork/
    gnuplot_no_fork(app, &bl)
  end
end