lib/rubyplot/artist/figure.rb
def add_subplot!(nrow, ncol)
        # FIXME: make this work for mutliple subplots.
        plottable_width = (@max_x - (@left_spacing + @right_spacing)).to_f
        plottable_length = (@max_y - (@top_spacing + @bottom_spacing)).to_f
        @subplots[nrow][ncol] = Rubyplot::Artist::Axes.new(
          self,
          abs_x: @left_spacing + (plottable_width / @ncols) * ncol,
          abs_y: @bottom_spacing + (plottable_length / @nrows) * nrow,
          width: plottable_width / @ncols,
          height: plottable_length / @nrows
        )
        @subplots[nrow][ncol]
      end
# Actually create a subplot at position (nrow, ncol) on the figure.
# You must call `add_subplots` and create space in the figure before
# calling this method. Returns the created Rubyplot::Axes object.
# 
# @param nrow [Integer] X co-ordinate of the subplot.
# @param ncol [Integer] Y co-ordinate of the subplot.
Actually create a subplot at position (nrow, ncol) on the figure.
You must call `add_subplots` and create space in the figure before
calling this method. Returns the created Rubyplot::Axes object.
Actually create a subplot at position ( nrow ncol ) on the figure . You must call ` add_subplots ` and create space in the figure before calling this method . Returns the created Rubyplot :: Axes object .
def add_subplot!(nrow, ncol)
        plottable_width = (@max_x - (@left_spacing + @right_spacing)).to_f
        plottable_length = (@max_y - (@top_spacing + @bottom_spacing)).to_f
        @subplots[nrow][ncol] = Rubyplot::Artist::Axes.new(
          self,
          abs_x: @left_spacing + (plottable_width / @ncols) * ncol,
          abs_y: @bottom_spacing + (plottable_length / @nrows) * nrow,
          width: plottable_width / @ncols,
          height: plottable_length / @nrows
        )
        @subplots[nrow][ncol]
      end
def add_subplot! ( nrow , ncol ) plottable_width = ( @max_x - ( @left_spacing + @right_spacing ) ) . to_f plottable_length = ( @max_y - ( @top_spacing + @bottom_spacing ) ) . to_f @subplots [ nrow ] [ ncol ] = Rubyplot :: Artist :: Axes . new ( self , abs_x : @left_spacing + ( plottable_width / @ncols ) * ncol , abs_y : @bottom_spacing + ( plottable_length / @nrows ) * nrow , width : plottable_width / @ncols , height : plottable_length / @nrows ) @subplots [ nrow ] [ ncol ] end
Actually create a subplot at position (nrow, ncol) on the figure.
Actually create a subplot at position ( nrow ncol ) on the figure .
# FIXME: make this work for mutliple subplots.
nrow
X co-ordinate of the subplot.
X co - ordinate of the subplot .
ncol
Y co-ordinate of the subplot.
Y co - ordinate of the subplot .