uipanel

Creates a frame for interactive graphical control objects in a figure.

Syntax

h = uipanel()

h = uipanel(property, value, ...)

h = uipanel(parent, property, value, ...)

Inputs

parent
Handle of a container object, which could be a figure, frame, uipanel, or uibuttongroup.
Type: double | integer
Dimension: scalar
property, value
aspectratio
Specifies if the aspect ratio for backgroundimage needs to be ignored (off) or retained (on). Default value is off, and the backgroundimage is resized to the dimensions of h.
Type: string
backgroundcolor
Specifies the background color. Valid values are transparent or a real vector specifying RGB values in the range 0-255 or 0-1.
Type: string | vector
backgroundimage
Specifies the background image; requires a path to a valid image file.
Type: string
bordertype
Specifies the border type. Valid options are beveledin | beveledout | etchedin (default) | etchedout | line | none
Type: string
borderwidth
Specifies the width of the border. Default value is 1.
Type: integer
createfcn
Function that is triggered when h is created. If value is a function handle, it must be a function that takes at least two arguments. The first argument is h and the second argument is ignored. If value is a string, it must represent a function handle or a function name. If value is a cell, it must contain the function name/function handle in the first cell element and parameters to pass to callback function in the additional elements. The"createfcn cannot be interrupted.
Type: cell | functionhandle | string
deletefcn
Function that is triggered when h is deleted. If value is a function handle, it must be a function that takes at least two arguments. The first argument is the handle of the uicontrol, h and the second argument is ignored. If value is a string, it must represent a function handle or a function name. If value is a cell, it must contain the function name/function handle in the first cell element and parameters to pass to callback function in the additional elements. The deletefcn cannot be interrupted.
Type: cell | functionhandle | string
enable
Specifies if h is enabled. Valid values are on(default) and off.
Type: string
fontangle
Specifies the angle of the displayed font. Valid values are regular(default) and italic.
Type: string
fontname
Specifies the name of the displayed font.
Type: string
fontsize
Specifies the size of the displayed font.
Type: scalar
fontunits
Determines if fontsize property is absolute or relative based on fontsize of the parent of h. Valid values are pixels (default) or normalized.
Type: string
fontweight
Specifies the weight of the displayed font. Valid values are normal(default) and bold.
Type: string
keypressfcn
Function triggered when there a key is pressed on h.
If value is a function handle, it must be a function that takes at least two arguments: the first is the handle and the second argument is ignored.
If value is a string, it must represent a function handle or a function name.
If value is a cell, it must contain the function name/function handle in the first cell element and parameters to pass to the callback function in the additional elements.
Type: cell | functionhandle | string
parent
Specifies the parent.
Type: scalar
position
Position and size of h. Value is specified as a vector of form: [left top width height]. If units has a value of normalized, values must be between 0 to 1.
Type: vector
string
Text to be displayed on h.
Type: string
tag
User-defined string to tag h.
Type: string
title
Text to be displayed on h.
Type: string
tooltipstring
Tooltip.
Type: string
units
Unit of measurement.
pixels
Default option which indicates that h has a fixed position and size specified position.
normalized
Indicates that h is moved/resized based on the size/position of the parent.
Type: string
userdata
User-defined numerical data.
Type: complex | mtx | scalar
value
User-defined scalar data.
Type: scalar
visible
Specifies if h is visible. Valid values are on(default) and off.
Type: string

Outputs

h
Handle of the uipanel.

Example

Creates a uipanel with a background image:
f = gcf;
 panel = uipanel(f, 'units', 'normalized', 'position', [0, 0, 0.99, 0.3], 'backgroundimage', 'image1.jpg');