Class: Plot::PlotProxy

Inherits:
Object
  • Object
show all
Defined in:
lib/plot/plot.rb

Instance Method Summary collapse

Constructor Details

#initialize(plot) ⇒ PlotProxy

Returns a new instance of PlotProxy.



21
22
23
# File 'lib/plot/plot.rb', line 21

def initialize(plot)
    @plot = plot
end

Instance Method Details

#mark(type, id, &block) ⇒ Object



25
26
27
28
29
30
# File 'lib/plot/plot.rb', line 25

def mark(type, id, &block)
    mark = Plot::Mark.new(nil)
    mark_proxy = Plot::MarkProxy.new(mark, type)
    mark_proxy.instance_eval(&block)
    @plot.add_mark(id, mark)
end

#plot_options(**options) ⇒ Object



32
33
34
# File 'lib/plot/plot.rb', line 32

def plot_options(**options)
    @plot.options = options
end