Class: Charty::Plotters::ScatterPlotter
- Inherits:
-
RelationalPlotter
- Object
- AbstractPlotter
- RelationalPlotter
- Charty::Plotters::ScatterPlotter
- Defined in:
- lib/charty/plotters/scatter_plotter.rb
Instance Attribute Summary collapse
-
#alpha ⇒ Object
Returns the value of attribute alpha.
-
#edge_color ⇒ Object
Returns the value of attribute edge_color.
-
#legend ⇒ Object
Returns the value of attribute legend.
-
#line_width ⇒ Object
Returns the value of attribute line_width.
Attributes inherited from RelationalPlotter
#color_norm, #input_format, #marker_order, #markers, #plot_data, #size, #size_norm, #size_order, #sizes, #style, #var_types, #variables
Attributes inherited from AbstractPlotter
#color, #color_order, #data, #key_color, #palette, #x, #y
Instance Method Summary collapse
-
#initialize(data: nil, variables: {}, **options, &block) ⇒ ScatterPlotter
constructor
A new instance of ScatterPlotter.
- #render ⇒ Object
- #save(filename, **opts) ⇒ Object
Methods inherited from AbstractPlotter
Constructor Details
#initialize(data: nil, variables: {}, **options, &block) ⇒ ScatterPlotter
Returns a new instance of ScatterPlotter.
4 5 6 7 |
# File 'lib/charty/plotters/scatter_plotter.rb', line 4 def initialize(data: nil, variables: {}, **, &block) x, y, color, style, size = variables.values_at(:x, :y, :color, :style, :size) super(x, y, color, style, size, data: data, **, &block) end |
Instance Attribute Details
#alpha ⇒ Object
Returns the value of attribute alpha.
9 10 11 |
# File 'lib/charty/plotters/scatter_plotter.rb', line 9 def alpha @alpha end |
#edge_color ⇒ Object
Returns the value of attribute edge_color.
40 41 42 |
# File 'lib/charty/plotters/scatter_plotter.rb', line 40 def edge_color @edge_color end |
#legend ⇒ Object
Returns the value of attribute legend.
9 10 11 |
# File 'lib/charty/plotters/scatter_plotter.rb', line 9 def legend @legend end |
#line_width ⇒ Object
Returns the value of attribute line_width.
40 41 42 |
# File 'lib/charty/plotters/scatter_plotter.rb', line 40 def line_width @line_width end |
Instance Method Details
#render ⇒ Object
50 51 52 53 54 55 56 |
# File 'lib/charty/plotters/scatter_plotter.rb', line 50 def render backend = Backends.current backend.begin_figure draw_points(backend) annotate_axes(backend) backend.show end |
#save(filename, **opts) ⇒ Object
58 59 60 61 62 63 64 |
# File 'lib/charty/plotters/scatter_plotter.rb', line 58 def save(filename, **opts) backend = Backends.current backend.begin_figure draw_points(backend) annotate_axes(backend) backend.save(filename, **opts) end |