Scilab Website | Contribute with GitLab | Mailing list archives | ATOMS toolboxes
Scilab Online Help
2023.1.0 - English


subplot

sets the current axes to a chosen cell of the current gridded figure

Syntax

subplot(m,n,p)
subplot(mnp)

Arguments

m, n, p

positive integers

mnp

an integer with decimal notation mnp

Description

subplot(m,n,p) or subplot(mnp) virtually grids the graphics window into an m-by-n matrix of sub-windows, and selects the pth sub-window for receiving the forthcoming drawings.

Into the grid, cells are indexed along each row, starting from the top row. Hence, for instance the last cell of the first row is the p = nth one. The cell on the row #i and the column #j has the index p=(i-1)*n+j.

When the selected area matches exactly an existing axes, subplot(…) just sets it as the current axes, and returns.

Otherwise, subplot(…) creates an empty axes covering the selected area, ready to receive forthcoming plotting contents.

Examples

clf
subplot(221)
plot2d()

subplot(222)
plot3d()

subplot(2,2,3)
param3d()

subplot(2,2,4)
bar3d()

A more complex layout, but still gridable:

clf
subplot(1,2,2)
Matplot1()
xtitle("Matplot1() example","","")

subplot(2,2,1)
histplot
delete(findobj("type","Legend"))

subplot(2,2,3)
title("Smaller plots:", "fontsize",3)

subplot(2,4,5)
polarplot()

subplot(2,4,6)
param3d()
xtitle("","","","")

See also

  • xsetech — set the sub-window of a graphics window for plotting
  • newaxes — Creates a new Axes entity
  • axes_properties — description of the axes entity properties
Report an issue
<< sda axes_operations unzoom >>

Copyright (c) 2022-2024 (Dassault Systèmes)
Copyright (c) 2017-2022 (ESI Group)
Copyright (c) 2011-2017 (Scilab Enterprises)
Copyright (c) 1989-2012 (INRIA)
Copyright (c) 1989-2007 (ENPC)
with contributors
Last updated:
Mon May 22 12:37:07 CEST 2023