Class MRPlot::Plot
In: mrplot.rb
Parent: Object

The plot class is the base for all graphs. There are different subclasses for different plots styles like BarPlot or XYPlot. The plot base class takes care of drawing the axis, grid, history, title and description. Every plot has also a PlotSpace which transforms coordinates from plot space to window space Using the plot’s draw method you can also draw different types of plots at the same time. These plots will share one coordinate system/one grid etc.

Methods

<<   add_dataset   draw   draw_naked   new  

Attributes

axes  [RW]  PlotObject
datasets  [R]  Array
description  [RW]  PlotObject
figures  [R]  Array
grid  [RW]  PlotObject
history  [RW]  PlotObject
history_symbol  [RW]  HistorySymbol
space  [RW]  PlotObject
title  [RW]  PlotObject

Public Class methods

Public Instance methods

<<(dataset)

Alias for add_dataset

Add a new dataset to the plot. Every dataset has a data container: discrete data (Array, Enumerable) or a function (ContinousData).

Draw the plot to a context within the bounds given by rect. The rect without the border is the windowspace. If you pass an array of plots they will be drawn (without grid, axes …) on top of the receiving plot.

Draw the plot, overwrite this method to implement your own plot type

[Validate]