Class: Rust::Plots::Grid

Inherits:
Renderable show all
Defined in:
lib/rust/plots/core.rb

Overview

Represents a grid for a plot.

Instance Method Summary collapse

Methods inherited from Renderable

#[]=

Constructor Details

#initializeGrid

Creates a new grid



274
275
276
277
278
279
# File 'lib/rust/plots/core.rb', line 274

def initialize
    super()
    
    @x = Float::NAN
    @y = Float::NAN
end

Instance Method Details

#_renderObject



335
336
337
338
339
340
341
342
343
344
345
# File 'lib/rust/plots/core.rb', line 335

def _render()
    function = Rust::Function.new("grid")
    
    function.arguments << @x
    function.arguments << @y
    function.options = @options
    
    function.call
    
    return self
end

#auto_xObject

Automatically sets the x intervals.



302
303
304
305
306
# File 'lib/rust/plots/core.rb', line 302

def auto_x
    @x = nil
    
    return self
end

#auto_yObject

Automatically sets the y intervals.



311
312
313
314
315
# File 'lib/rust/plots/core.rb', line 311

def auto_y
    @y = nil
    
    return self
end

#hide_xObject

Hides x axis lines.



320
321
322
323
324
# File 'lib/rust/plots/core.rb', line 320

def hide_x
    @x = Float::NAN
    
    return self
end

#hide_yObject

Hides y axis lines.



329
330
331
332
333
# File 'lib/rust/plots/core.rb', line 329

def hide_y
    @y = Float::NAN
    
    return self
end

#x(value) ⇒ Object

Sets the x intervals.



284
285
286
287
288
# File 'lib/rust/plots/core.rb', line 284

def x(value)
    @x = value
    
    return self
end

#y(value) ⇒ Object

Sets the y intervals.



293
294
295
296
297
# File 'lib/rust/plots/core.rb', line 293

def y(value)
    @y = value
    
    return self
end