Back to Data Visualization
subplot
Create subplot grid
Syntax
subplot(rows, cols, index)
Description
Creates a grid of charts with the specified number of rows and columns, and activates the subplot at the given index (1-based).
Parameters
| Name | Description |
|---|---|
| rows | Number of rows in grid |
| cols | Number of columns in grid |
| index | 1-based position in grid (row-major order) |
Returns
null
Examples
Try It
>> subplot(2, 2, 1); plot([1 2 3]); subplot(2, 2, 2); bar([4 5 6])