Class: Cosmos::XyPlot

Inherits:
LinegraphPlot show all
Defined in:
lib/cosmos/tools/tlm_grapher/plots/xy_plot.rb

Overview

Represents an X-Y plot

Direct Known Subclasses

SinglexyPlot

Instance Attribute Summary collapse

Attributes inherited from LinegraphPlot

#left_y_axis_title, #manual_left_y_scale, #manual_right_y_scale, #manual_x_grid_line_scale, #manual_y_grid_line_scale, #point_size, #right_y_axis_title, #show_abs_x_grid_labels, #show_legend, #show_lines, #show_x_grid_lines, #show_y_grid_lines, #title, #unix_epoch_x_values, #utc_time, #x_axis_title

Attributes inherited from Plot

#data_objects, #gui_object, #plot_type, #redraw_needed, #tab

Instance Method Summary collapse

Methods inherited from Plot

#configuration_string

Constructor Details

#initializeXyPlot

Creates a new plot



23
24
25
26
27
28
29
# File 'lib/cosmos/tools/tlm_grapher/plots/xy_plot.rb', line 23

def initialize
  super()
  @show_lines = false
  @x_axis_title = nil
  @manual_x_scale = nil
  @unix_epoch_x_values = false
end

Instance Attribute Details

#manual_x_scaleObject

Manual x scale array of x_min and x_max



20
21
22
# File 'lib/cosmos/tools/tlm_grapher/plots/xy_plot.rb', line 20

def manual_x_scale
  @manual_x_scale
end

Instance Method Details

#handle_keyword(parser, keyword, parameters) ⇒ Object

Handles plot specific keywords



32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# File 'lib/cosmos/tools/tlm_grapher/plots/xy_plot.rb', line 32

def handle_keyword(parser, keyword, parameters)
  case keyword
  when 'MANUAL_X_AXIS_SCALE'
    # Expect 2 parameters
    parser.verify_num_parameters(2, 2, "MANUAL_X_AXIS_SCALE <X Min> <X Max>")
    manual_scale = []
    manual_scale[0] = parameters[0].to_f
    manual_scale[1] = parameters[1].to_f
    @manual_x_scale = manual_scale

  else
    # Unknown keywords are passed to parent data object
    super(parser, keyword, parameters)

  end # case keyword

end