Class: UnicodePlot::Lineplot

Inherits:
GridCanvas show all
Defined in:
lib/unicode_plot/lineplot.rb

Constant Summary

Constants inherited from GridCanvas

GridCanvas::DEFAULT_HEIGHT, GridCanvas::DEFAULT_WIDTH, GridCanvas::MIN_HEIGHT, GridCanvas::MIN_WIDTH

Constants inherited from Plot

Plot::COLOR_CYCLE, Plot::DEFAULT_BORDER, Plot::DEFAULT_MARGIN, Plot::DEFAULT_PADDING

Constants included from StyledPrinter

StyledPrinter::COLOR_DECODE, StyledPrinter::COLOR_ENCODE, StyledPrinter::DISABLE_TEXT_STYLE, StyledPrinter::TEXT_COLORS

Instance Attribute Summary

Attributes inherited from Plot

#border, #colors_deco, #colors_left, #colors_right, #decorations, #labels_left, #labels_right, #margin, #padding, #title, #xlabel, #ylabel

Instance Method Summary collapse

Methods inherited from GridCanvas

#ceil_neg_log10, #extend_limits, #lines!, #n_columns, #n_rows, #origin_x, #origin_y, #plot_height, #plot_width, #plotting_range_narrow, #points!, #print_row, #round_down_subtick, #round_up_subtick, #roundable?

Methods inherited from Plot

#annotate!, #annotate_row!, #next_color, #render, #show_labels?, #title_given?, #to_s, #xlabel_given?, #ylabel_given?, #ylabel_length

Methods included from StyledPrinter

#color?, #print_color, #print_styled

Constructor Details

#initialize(x, y, canvas, **kw) ⇒ Lineplot

Returns a new instance of Lineplot.



155
156
157
158
159
160
161
162
163
164
# File 'lib/unicode_plot/lineplot.rb', line 155

def initialize(x, y, canvas,
               **kw)
  if x.length != y.length
    raise ArgumentError, "x and y must be the same length"
  end
  unless x.length > 0
    raise ArgumentError, "x and y must not be empty"
  end
  super(x, y, canvas, **kw)
end