Class: Rust::Plots::ScatterPlot

Inherits:
BasePlot show all
Defined in:
lib/rust-plots.rb

Instance Method Summary collapse

Methods inherited from BasePlot

#[]=, #_add_renderable, #_do_not_override_options!, #axis, #color, #grid, #palette, #pdf, #show, #title, #x_label, #x_range, #y_label, #y_range

Constructor Details

#initialize(x = nil, y = nil, **options) ⇒ ScatterPlot

Returns a new instance of ScatterPlot.



138
139
140
141
142
143
144
# File 'lib/rust-plots.rb', line 138

def initialize(x = nil, y = nil, **options)
    super()
    @series = []
    if x && y
        self.series(x, y, options)
    end
end

Instance Method Details

#linesObject



158
159
160
161
162
# File 'lib/rust-plots.rb', line 158

def lines()
    self['type'] = "l"
    
    return self
end

#lines_and_pointsObject



170
171
172
173
174
# File 'lib/rust-plots.rb', line 170

def lines_and_points()
    self['type'] = "b"
    
    return self
end

#pointsObject



164
165
166
167
168
# File 'lib/rust-plots.rb', line 164

def points()
    self['type'] = "p"
    
    return self
end

#series(x, y, **options) ⇒ Object



146
147
148
149
150
# File 'lib/rust-plots.rb', line 146

def series(x, y, **options)
    @series << [x, y, options]
    
    return self
end

#thickness(t) ⇒ Object



152
153
154
155
156
# File 'lib/rust-plots.rb', line 152

def thickness(t)
    self['lwd'] = t
    
    return self
end