Skip to content

OccupiedCellError(row, column) Source

Bases: NumdaplotError

Raised when a Plot is placed on a cell of a Figure already covered by another Plot, even partly.

Added in version 0.1.0

Parameters:

  • row (int)

    The row of the first occupied cell, from 0.

  • column (int)

    The column of the first occupied cell, from 0.

Attributes:

  • row

    The row of the first occupied cell, from 0.

  • column

    The column of the first occupied cell, from 0.

Examples:

import numdaplot as ndp

prices = ndp.Array.from_list([12.0, 15.5, 14.0])
plot = ndp.Plot.line(prices)
figure = ndp.Figure(ndp.Layout(rows=1, columns=2))
first_cell = ndp.Cell(row=0, column=0)
figure = figure.place(plot, first_cell)
try:
    figure.place(plot, first_cell)
except ndp.OccupiedCellError as error:
    print(error)
# Cell (0, 0) already holds a Plot.