topotoolbox.gen_random_bool#
- topotoolbox.gen_random_bool(rows: int = 32, columns: int = 32, cellsize: float = 10.0, name: str = 'random grid') GridObject[source]#
Generate a GridObject instance that contains only randomly generated Boolean values.
- Parameters:
rows (int, optional) – Number of rows. Defaults to 32.
columns (int, optional) – Number of columns. Defaults to 32.
cellsize (float, optional) – Size of each cell in the grid. Defaults to 10.0.
- Returns:
An instance of GridObject with randomly generated Boolean values.
- Return type:
Example
>>> import topotoolbox >>> import matplotlib.pyplot as plt >>> dem = topotoolbox.gen_random_bool() >>> _= dem.plot(cmap='grey') >>> plt.show()
(
Source code,png,hires.png,pdf)