Nelson
  • Nelson GitBook 📚
  • docs
    • Nelson Documentation
  • markdown
    • Languages
    • en
      • Summary
      • Assertion functions
        • SUMMARY
        • assert
        • assert_checkerror
        • assert_isapprox
        • assert_isequal
        • assert_isfalse
        • assert_istrue
      • Audio playback
        • SUMMARY
        • audiodevinfo
        • audioinfo
        • audiometadata
        • audioplayer
        • audioplayer_delete
        • audioplayer_fieldnames
        • audioplayer_get
        • audioplayer_pause
        • audioplayer_set
        • audioplayer_stop
        • audioplayer_used
        • audioread
        • audiosupportedformats
        • audiowrite
        • beep
        • isplaying
        • lin2mu
        • mu2lin
        • play
        • playblocking
        • resume
        • sound
        • soundsc
        • stop
      • changelogs
        • CHANGELOG-0.1.x
        • CHANGELOG-0.2.x
        • CHANGELOG-0.3.x
        • CHANGELOG-0.4.x
        • CHANGELOG-0.5.x
        • Changelog
        • Changelog
        • Changelog
      • Characters encoding
        • SUMMARY
        • native2unicode
        • nativecharset
        • unicode2native
      • COM engine
        • COM examples
        • COM_delete
        • COM_fieldnames
        • COM_get
        • COM_invoke
        • COM_ismethod
        • COM_isprop
        • COM_methods
        • COM_range
        • COM_set
        • COM_used
        • COM_xlsfinfo
        • COM_xlsread
        • COM_xlswrite
        • SUMMARY
        • actxGetRunningServer
        • actxcontrollist
        • actxserver
        • actxserverlist
        • iscom
      • Console
        • SUMMARY
        • clc
        • input
        • terminal_size
      • Constructors functions
        • Inf
        • NaN
        • SUMMARY
        • diag
        • eps
        • eye
        • i
        • ones
        • pi
        • zeros
      • Control System functions
        • SUMMARY
        • abcdchk
        • acker
        • append
        • augstate
        • balreal
        • bdschur
        • bode
        • c2d
        • care
        • cloop
        • compreal
        • ctrb
        • ctrbf
        • d2c
        • damp
        • dare
        • dcgain
        • dlqr
        • dlyap
        • dsort
        • esort
        • evalfr
        • feedback
        • freqresp
        • gensig
        • gram
        • hsvd
        • impulse
        • initial
        • isct
        • isdt
        • islti
        • issiso
        • isstatic
        • kalman
        • lqe
        • lqed
        • lqr
        • lqry
        • lsim
        • lyap
        • minreal
        • nyquist
        • obsv
        • obsvf
        • ord2
        • padecoef
        • parallel
        • pole
        • series
        • ss
        • ss2tf
        • ssdata
        • ssdelete
        • ssselect
        • step
        • tf
        • tf2ss
        • tfdata
        • tzero
        • zero
      • Core
        • SUMMARY
        • banner
        • eval
        • evalc
        • evalin
        • execstr
        • exist
        • exit
        • feature
        • inputname
        • isunicodesupported
        • license
        • maxNumCompThreads
        • namelengthmax
        • nargin
        • narginchk
        • nargout
        • nargoutchk
        • nelsonroot
        • nfilename
        • pause
        • prefdir
        • quit
        • run
        • sha256
        • version
      • Data analysis
        • SUMMARY
        • conv
        • conv2
        • cumprod
        • cumsum
        • ismissing
        • issorted
        • max
        • min
        • prod
        • sort
        • sum
        • unique
      • Data structures
        • SUMMARY
        • cell
        • cell2mat
        • cell2struct
        • celldisp
        • cellfun
        • cellstr
        • fieldnames
        • getfield
        • iscellstr
        • isfield
        • namedargs2cell
        • num2cell
        • orderfields
        • rmfield
        • setfield
        • struct
        • struct2cell
      • Debugger functions
        • SUMMARY
        • dbstack
      • Dictionaries
        • SUMMARY
        • configureDictionary
        • dictionary
        • entries
        • insert
        • isConfigured
        • isKey
        • keyHash
        • keyMatch
        • keys
        • lookup
        • numEntries
        • remove
        • types
        • values
      • Display format
        • SUMMARY
        • disp
        • display
        • echo
        • format
        • formattedDisplayText
      • Double
        • SUMMARY
        • double
        • flintmax
        • realmax
        • realmin
      • Dynamic link
        • Build C/C++ code on the fly
        • Supported C/C++ compilers
        • libpointer datatype
        • SUMMARY
        • cmake
        • configuremingw
        • configuremsvc
        • dlcall
        • dlclose
        • dlgeneratecleaner
        • dlgenerategateway
        • dlgenerateloader
        • dlgeneratemake
        • dlgenerateunloader
        • dlgetnelsonincludes
        • dlgetnelsonlibraries
        • dllib_used
        • dllibinfo
        • dllibisloaded
        • dlmake
        • dlopen
        • dlsym
        • dlsym_delete
        • dlsym_used
        • findcmake
        • getdynlibext
        • havecompiler
        • libpointer
        • libpointer_delete
        • libpointer_isNull
        • libpointer_plus
        • libpointer_reshape
        • libpointer_setdatatype
        • libpointer_used
        • loadcompilerconf
        • removecompilerconf
        • vswhere
      • Elementary functions
        • SUMMARY
        • abs
        • allfinite
        • angle
        • base2dec
        • bernsteinMatrix
        • bin2dec
        • bin2num
        • blkdiag
        • cast
        • ceil
        • circshift
        • complex
        • conj
        • deal
        • dec2base
        • dec2bin
        • dec2hex
        • exp
        • factorial
        • filter
        • find
        • fix
        • flip
        • flipdim
        • fliplr
        • flipud
        • floor
        • hadamard
        • hankel
        • hex2dec
        • hilb
        • hypot
        • imag
        • ind2sub
        • invhilb
        • ipermute
        • isapprox
        • iscolumn
        • istriu
        • isequal
        • isequaln
        • isequalto
        • isfinite
        • isinf
        • ismatrix
        • isnan
        • isrow
        • isscalar
        • istril
        • istriu
        • isvector
        • length
        • linspace
        • log
        • log10
        • log1p
        • log2
        • logspace
        • magic
        • meshgrid
        • minus
        • mod
        • ndgrid
        • ndims
        • nextpow2
        • norm
        • normest
        • nthroot
        • num2bin
        • numel
        • permute
        • pinv
        • pow2
        • real
        • rem
        • repmat
        • reshape
        • rosser
        • rot90
        • round
        • shiftdim
        • sign
        • size
        • sqrt
        • squeeze
        • sub2ind
        • substruct
        • swapbytes
        • toeplitz
        • tril
        • triu
        • vander
        • wilkinson
      • Engine
        • SUMMARY
        • argv
        • executable
        • finish
        • getnelsonmode
        • isquietmode
        • System Requirements
        • #! shebang
        • startup
      • Error manager
        • MException
        • SUMMARY
        • error
        • getLastReport
        • lasterror
        • lastwarn
        • rethrow
        • throw
        • throwAsCaller
        • warning
      • Fortran to C
        • SUMMARY
        • f2c
      • FFTW
        • FFTW License
        • FFTWwrapper
        • SUMMARY
        • fft
        • fft2
        • fftn
        • fftshift
        • fftw
        • ifft
        • ifftn
        • ifftshift
      • File archiver functions
        • SUMMARY
        • unzip
        • zip
      • Files and folders functions
        • SUMMARY
        • cd
        • copyfile
        • diff_file
        • dir
        • fileparts
        • filesep
        • fullfile
        • fullpath
        • isdir
        • isfile
        • isfolder
        • ls
        • mkdir
        • pathsep
        • pwd
        • relativepath
        • rmdir
        • rmfile
        • tempdir
        • tempname
        • userdir
      • Function_handle functions
        • SUMMARY
        • Anonymous Functions
        • func2str
        • isfunction_handle
        • str2func
      • Functions manager
        • SUMMARY
        • addpath
        • builtin
        • clearfun
        • feval
        • inmem
        • isbuiltin
        • ismacro
        • ismex
        • macroargs
        • path
        • private functions
        • rehash
        • restoredefaultpath
        • rmpath
        • userpath
        • what
        • which
      • Geometry
        • SUMMARY
        • rotx
        • roty
        • rotz
      • Graphics functions
        • SUMMARY
        • abyss
        • ancestor
        • autumn
        • axes
        • axis
        • bar
        • bone
        • cla
        • clf
        • clim
        • close
        • colorbar
        • colormap
        • colstyle
        • contour
        • contour3
        • cool
        • copper
        • cylinder
        • drawnow
        • figure
        • fill
        • frame2im
        • gca
        • gcf
        • getframe
        • Managing Callback Interruptions in Nelson
        • gray
        • grid
        • groot
        • hggroup
        • hist
        • hold
        • hot
        • im2double
        • im2frame
        • image
        • imagesc
        • imread
        • imshow
        • imwrite
        • is2D
        • isValidGraphicsProperty
        • isgraphics
        • ishold
        • jet
        • legend
        • line
        • loglog
        • mesh
        • meshz
        • movie
        • newplot
        • pan
        • parula
        • patch
        • pcolor
        • pie
        • pink
        • plot
        • plot3
        • quiver
        • refresh
        • rgbplot
        • ribbon
        • rotate3d
        • saveas
        • scatter
        • semilogx
        • semilogy
        • sky
        • sphere
        • spring
        • spy
        • stairs
        • stem
        • subplot
        • summer
        • surf
        • surface
        • text
        • title
        • turbo
        • uicontrol
        • validatecolor
        • view
        • viridis
        • waitfor
        • waitforbuttonpress
        • waterfall
        • white
        • winter
        • xlabel
        • xlim
        • ylabel
        • ylim
        • zlabel
        • zlim
        • zoom
      • Graphics I/O functions
        • SUMMARY
        • copygraphics
        • imformats
        • imread
        • imwrite
        • saveas
      • Gui module
        • SUMMARY
        • commandhistory
        • errordlg
        • filebrowser
        • helpdlg
        • inserthtml
        • lookandfeel
        • msgbox
        • qt_verbose
        • questdlg
        • uigetdir
        • helpdlg
        • workspace
      • Handle
        • SUMMARY
        • delete
        • get
        • invoke
        • ismethod
        • isprop
        • isvalid
        • methods
        • properties
        • set
      • HDF5
        • SUMMARY
        • h5create
        • h5dump
        • h5ls
        • h5read
        • h5readatt
        • h5write
        • h5writeatt
        • isnh5file
        • loadnh5
        • savenh5
        • whonh5
        • whosnh5
      • Help browser functions
        • SUMMARY
        • doc
        • helpbrowser
      • Help tools functions
        • SUMMARY
        • buildhelp
        • buildhelpmd
        • buildhelpweb
        • docroot
        • headcomments
        • htmltopdf
        • markdown
        • xmldocbuild
        • xmldocchecker
        • xmldoctohelp
        • xmldoctohtml
        • xmldoctomd
      • History manager
        • SUMMARY
        • history
      • I18n functions
        • SUMMARY
        • gettext
        • i18nHelpers
        • poheader
      • Integers type
        • SUMMARY
        • int16
        • int32
        • int64
        • int8
        • intmax
        • intmin
        • uint16
        • uint32
        • uint64
        • uint8
      • Interpreter functions
        • SUMMARY
        • abort
        • break
        • continue
        • for
        • function
        • if
        • iskeyword
        • keyboard
        • max_recursion_depth
        • numeric types
        • parsefile
        • parsestring
        • switch
        • try
        • while
      • Inter Process Communication
        • SUMMARY
        • getpid
        • ipc
      • JavaScript Object Notation
        • SUMMARY
        • jsondecode
        • jsonencode
        • jsonprettyprint
      • Julia engine
        • SUMMARY
        • jlenv
        • jlrun
        • jlrunfile
        • Julia Nelson types
      • license
        • gpl-3.0
        • GNU LESSER GENERAL PUBLIC LICENSE
        • Nelson license:
      • Linear algebra
        • SUMMARY
        • balance
        • bandwidth
        • chol
        • cond
        • condeig
        • det
        • diff
        • eig
        • expm
        • gradient
        • inv
        • isbanded
        • ishermitian
        • issymmetric
        • kron
        • logm
        • lu
        • orth
        • planerot
        • rank
        • rcond
        • rref
        • rsf2csf
        • schur
        • sqrtm
        • subspace
        • svd
        • trace
        • vecnorm
      • Localization functions
        • SUMMARY
        • getavailablelanguages
        • getdefaultlanguage
        • getlanguage
        • setlanguage
      • Logical type functions
        • SUMMARY
        • false
        • logical
        • true
        • xor
      • MATIO
        • SUMMARY
        • ismatfile
        • loadmat
        • savemat
        • whomat
        • whosmat
      • Memory manager functions
        • SUMMARY
        • acquirevar
        • assignin
        • clear
        • global
        • isglobal
        • isvar
        • memory
        • persistent
        • varislock
        • varlock
        • varunlock
        • who
        • whos
      • MEX functions
        • SUMMARY
        • dlgeneratemexgateway
        • engClose
        • engEvalString
        • engGetVariable
        • engGetVisible
        • engOpen
        • engOpenSingleUse
        • engOutputBuffer
        • engPutVariable
        • engSetVisible
        • mex
        • mexAtExit
        • mexCallMATLAB
        • mexCallMATLABWithTrap
        • mexext
      • Modules manager
        • SUMMARY
        • addgateway
        • addmodule
        • gatewayinfo
        • getmodules
        • ismodule
        • module.json
        • modulepath
        • nmm
        • nmm_build_help
        • nmm_build_loader
        • removegateway
        • removemodule
        • requiremodule
        • semver
        • toolboxdir
        • usermodulesdir
      • Message Passing Interface
        • MPI_Allreduce
        • MPI_Barrier
        • MPI_Bcast
        • MPI_Comm_delete
        • MPI_Comm_get_name
        • MPI_Comm_object
        • MPI_Comm_rank
        • MPI_Comm_size
        • MPI_Comm_split
        • MPI_Comm_used
        • MPI_Finalize
        • MPI_Get_library_version
        • MPI_Get_processor_name
        • MPI_Get_version
        • MPI_Init
        • MPI_Initialized
        • MPI_Iprobe
        • MPI_Probe
        • MPI_Recv
        • MPI_Reduce
        • MPI_Send
        • MPI examples
        • MPI overview
        • SUMMARY
        • mpiexec
      • NIG
        • SUMMARY
        • nig
      • Operators
        • SUMMARY
        • all
        • and
        • any
        • bitand
        • bitor
        • bitxor
        • cat
        • colon
        • ctranspose
        • eq
        • ge
        • gt
        • horzcat
        • ismember
        • ldivide
        • le
        • lt
        • minus
        • mldivide
        • mpower
        • mrdivide
        • mtimes
        • ne
        • not
        • or
        • plus
        • power
        • rdivide
        • shortcutand
        • shortcutor
        • subsasgn
        • subsindex
        • subsref
        • mtimes
        • transpose
        • uminus
        • uplus
        • vertcat
      • OS functions
        • SUMMARY
        • cmdsep
        • computer
        • createGUID
        • getenv
        • hostname
        • ismac
        • ispc
        • isunix
        • searchenv
        • setenv
        • system
        • username
        • winopen
        • winqueryreg
      • Overloading
        • SUMMARY
        • overloading
      • Parallel
        • SUMMARY
        • afterAll
        • afterEach
        • backgroundPool
        • cancel
        • cancelAll
        • fetchNext
        • fetchOutputs
        • parfeval
        • wait
      • Polynomials
        • SUMMARY
        • deconv
        • poly
        • polyder
        • polyfit
        • polyint
        • polyval
        • polyvalm
        • roots
      • Profiling tools
        • SUMMARY
        • profile
        • profsave
      • Python engine
        • The power of calling Python from Nelson
        • How to install python package
        • Python Nelson types
        • Python operators
        • SUMMARY
        • pyargs
        • pyenv
        • pyrun
        • pyrunfile
      • QML engine
        • QObject_classname
        • QObject_findchildren
        • QObject_get
        • QObject_iswidgettype
        • QObject_iswindowtype
        • QObject_methodsignature
        • QObject_root
        • QObject_set
        • QObject_undefine
        • QObject_used
        • SUMMARY
        • nelsonObject
        • qml_addimportpath
        • qml_addpluginpath
        • qml_clearcomponentcache
        • qml_collectgarbage
        • qml_createqquickview
        • qml_demos
        • qml_evaluatefile
        • qml_evaluatestring
        • qml_importpathlist
        • qml_loadfile
        • qml_loadstring
        • qml_offlinestoragepath
        • qml_pluginpathlist
        • qml_setofflinestoragepath
        • qt_constant
        • qt_version
      • Random
        • SUMMARY
        • rand
        • randn
        • randperm
        • rng
      • Signal Processing
        • SUMMARY
        • bartlett
        • blackman
        • db2mag
        • db2pow
        • filter2
        • hamming
        • hann
        • mag2db
        • pow2db
        • sinc
        • xcorr2
        • zp2tf
      • Single type
        • SUMMARY
        • single
      • SIO client
        • SUMMARY
        • doc
        • sioemit
        • siogetvariable
      • Subroutine Library In COntrol Theory
        • SLICOT License
        • SUMMARY
        • slicot_ab01od
        • slicot_ab04md
        • slicot_ab07nd
        • slicot_ab08nd
        • slicot_ag08bd
        • slicot_mb02md
        • slicot_mb03od
        • slicot_mb03pd
        • slicot_mb03rd
        • slicot_mb04gd
        • slicot_mb04md
        • slicot_mb05od
        • slicot_mc01td
        • slicot_sb01bd
        • slicot_sb02od
        • slicot_sb03md
        • slicot_sb03od
        • slicot_sb04md
        • slicot_sb04qd
        • slicot_sb10jd
        • slicot_sg02ad
        • slicot_tb01id
        • slicot_tg01ad
      • Sparse type
        • IJV
        • SUMMARY
        • full
        • nnz
        • nzmax
        • sparse
        • speye
        • spones
      • Special functions
        • SUMMARY
        • betainc
        • cross
        • dot
        • factor
        • gamma
        • gammaln
        • gcd
        • interp1
        • peaks
        • primes
      • Spreadsheet
        • SUMMARY
        • csvread
        • csvwrite
        • detectImportOptions
        • dlmread
        • dlmwrite
        • readcell
        • readmatrix
        • readtable
        • writecell
        • writematrix
        • writetable
      • Statistics
        • SUMMARY
        • corrcoef
        • cov
        • mean
        • normpdf
        • var
      • Stream manager
        • SUMMARY
        • diary
        • fclose
        • feof
        • ferror
        • fgetl
        • fgets
        • fileread
        • filewrite
        • fopen
        • fprintf
        • fread
        • frewind
        • fscanf
        • fseek
        • fsize
        • ftell
        • fwrite
        • load
        • save
        • sscanf
      • String type
        • SUMMARY
        • append
        • blanks
        • char
        • contains
        • convertCharsToStrings
        • convertStringsToChars
        • count
        • deblank
        • endsWith
        • int2str
        • isStringScalar
        • isletter
        • isspace
        • join
        • mat2str
        • matches
        • newline
        • num2str
        • replace
        • sprintf
        • startsWith
        • str2double
        • strcat
        • strcmp
        • strcmpi
        • strfind
        • string
        • strings
        • strjust
        • strlength
        • strncmp
        • strncmpi
        • strrep
        • strtrim
        • tolower
        • toupper
      • Tables
        • Accessing and Manipulating Tables in Nelson
        • Direct computation with Table
        • Read/Write table to files
        • SUMMARY
        • array2table
        • cell2table
        • head
        • height
        • istable
        • removevars
        • renamevars
        • struct2table
        • table
        • table2array
        • table2cell
        • table2struct
        • tail
        • width
      • Tests manager
        • SUMMARY
        • test_makeref
        • test_run
        • skip_testsuite
      • Text editor
        • SUMMARY
        • edit
        • editor
        • smartindent
      • Time functions
        • SUMMARY
        • addtodate
        • calendar
        • clock
        • cputime
        • date
        • datenum
        • datestr
        • datevec
        • eomday
        • etime
        • hour
        • leapyear
        • minute
        • now
        • second
        • sleep
        • tic
        • time
        • timeit
        • toc
        • weekday
      • Trigonometric functions
        • SUMMARY
        • acos
        • acosd
        • acosh
        • acot
        • acotd
        • acoth
        • acsc
        • acscd
        • acsch
        • asec
        • asecd
        • asech
        • asin
        • asind
        • asinh
        • atan
        • atan2
        • atan2d
        • atand
        • atanh
        • cart2pol
        • cart2sph
        • cos
        • cosd
        • cosh
        • cosm
        • cospi
        • cot
        • cotd
        • coth
        • csc
        • cscd
        • csch
        • deg2rad
        • pol2cart
        • rad2deg
        • sec
        • secd
        • sech
        • sin
        • sind
        • sinh
        • sinm
        • sinpi
        • sph2cart
        • tan
        • tand
        • tanh
        • tanm
      • Types module
        • SUMMARY
        • class
        • isa
        • iscell
        • ischar
        • isclass
        • isdouble
        • isempty
        • isfloat
        • ishandle
        • isint16
        • isint32
        • isint64
        • isint8
        • isinteger
        • islogical
        • isnumeric
        • isobject
        • isreal
        • issingle
        • issparse
        • isstring
        • isstruct
        • isuint16
        • isuint32
        • isuint64
        • isuint8
        • isvarname
      • Validators
        • SUMMARY
        • mustBeA
        • mustBeColumn
        • mustBeFile
        • mustBeFinite
        • mustBeFloat
        • mustBeFolder
        • mustBeGreaterThan
        • mustBeGreaterThanOrEqual
        • mustBeInRange
        • mustBeInteger
        • mustBeLessThan
        • mustBeLessThanOrEqual
        • mustBeLogical
        • mustBeLogicalScalar
        • mustBeMatrix
        • mustBeMember
        • mustBeNegative
        • mustBeNonNan
        • mustBeNonSparse
        • mustBeNonZero
        • mustBeNonempty
        • mustBeNonmissing
        • mustBeNonnegative
        • mustBeNonpositive
        • mustBeNonzeroLengthText
        • mustBeNumeric
        • mustBeNumericOrLogical
        • mustBePositive
        • mustBeReal
        • mustBeRow
        • mustBeScalarOrEmpty
        • mustBeSparse
        • mustBeText
        • mustBeTextScalar
        • mustBeValidVariableName
        • mustBeVector
      • Web tools
        • SUMMARY
        • checkupdate
        • repo
        • urlencode
        • weboptions
        • webread
        • websave
        • webwrite
    • fr
      • changelogs
        • CHANGELOG-0.1.x
        • CHANGELOG-0.2.x
        • CHANGELOG-0.3.x
        • CHANGELOG-0.4.x
        • CHANGELOG-0.5.x
        • Changelog
        • Changelog
        • Changelog
      • license
        • gpl-3.0
        • GNU LESSER GENERAL PUBLIC LICENSE
        • Nelson license:
Powered by GitBook
On this page
  • Syntax
  • Input argument
  • Output argument
  • Description
  • Examples
  • See also
  • History
  • Author

Was this helpful?

  1. markdown
  2. en
  3. Graphics functions

patch

Create patches of colored polygons

Syntax

  • patch(X, Y, C)

  • patch(X, Y, Z, C)

  • patch('XData', X, 'YData', Y)

  • patch('XData', X, 'YData', Y, 'ZData', Z)

  • patch('Faces', F, 'Vertices', V)

  • patch(S)

  • patch(..., propertyName, propertyValue)

  • patch(ax, ...)

  • go = patch(...)

Input argument

  • X - x-coordinates: vector or matrix.

  • Y - y-coordinates: vector or matrix.

  • Z - z-coordinates: vector or matrix.

  • C - Color array: scalar, vector, m-by-n-by-3 array of RGB triplets.

  • ax - a scalar graphics object value: parent container, specified as a axes.

  • propertyName - a scalar string or row vector character.

  • propertyValue - a value.

  • S - a structure with fields that correspond patch property names and field values.

Output argument

  • go - a graphics object: patch type.

Description

patch(X, Y, C) creates a 2D polygonal shape with vertices defined by X and Y coordinates, and fills the shape with color C.

patch(X, Y, Z, C) creates a 3D polygonal shape with vertices defined by X, Y, and Z coordinates, and fills the shape with color C.

patch(..., PropertyName, PropertyValue, ...) sets optional properties for the patch object using name-value pairs.

patch('Faces', F, 'Vertices', V) creates one or more polygons .

go = patch(...) returns the handle go to the created patch object.

Property Name-Value Pairs:

'FaceColor': color of the filled shape. FaceColor can be a character vector or a 3-element RGB vector. Default: 'flat'.

'EdgeColor': color of the edges of the polygonal shape. EdgeColor can be a character vector or a 3-element RGB vector. Default: 'none'.

'LineWidth': width of the edges of the polygonal shape. Default: 0.5.

'LineStyle': style of the edges of the polygonal shape. LineStyle can be a character vector or a line style code. Default: '-'.

'FaceAlpha': transparency of the filled shape. FaceAlpha can be a scalar between 0 and 1. Default: 1.

'EdgeAlpha': transparency of the edges of the polygonal shape. EdgeAlpha can be a scalar between 0 and 1. Default: 1.

'Parent': handle of the parent object for the patch. Default: gca().

'Vertices': matrix of vertex coordinates. The matrix must have size N-by-2 or N-by-3, where N is the number of vertices. Default: the vertex coordinates are specified by the X, Y, and Z input arguments.

CreateFcnCallback (function handle, string or cell) called when object is created. Set this property on an existing component has no effect.

DeleteFcnCallback (function handle, string or cell) called when object is deleted.

BeingDeleted Flag indicating that the object is being deleted.

Examples

fig = figure('Color', 'k');
ax.Color = 'k';
f=0.1;
t=0:f^2:2*pi;
r=pi/4;
p=r*t+r;
patch([cos(p), 0], [sin(p), 0], 'y');
c = eye(3);
for a=2:2:6
  patch([t/4+a, a+r*(1+cos(t/2)),a], [-f*cos(3*(a+t))-r,r*sin(t/2),-1], c(a/2,:));
  patch(a +f*cos(t)'+r./[1,0.65], f*(2+sin(t)').*[1,1], 'k', 'EdgeColor', 'w', 'LineWidth', pi)
end
axis equal
axis off
f =figure('Color', 'w');
x = [-1 1 0 -1];
y = [-1/sqrt(3) -1/sqrt(3) 2*sqrt(3)/3 -1/sqrt(3)];
plot(x,y,'k','LineWidth',3);
t = 0:0.001:2*pi;
xc = cos(t)/3+x';
yc = sin(t)/3-y';
for i = 1:3
    patch(xc(i,:),yc(i,:),'k');
end
patch(x,-y,'w','EdgeColor','w');
axis('equal')
axis('off')

Nerfertiti 3D mask

nefertiti_directory = [modulepath('graphics', 'root'), '/examples/nefertiti-mask/'];
load([nefertiti_directory, 'nefertiti-mask.nh5']);
figure('Color', [1, 1, 1]);
patch('Faces', Faces, 'Vertices', Vertices, 'FaceVertexCData', Colors, ...
      'EdgeColor', 'none', ...
      'FaceColor', 'interp', 'FaceAlpha', 1);
axis equal
axis off
view([0, 0, 1]);

Alpha channel

x = [1 3 4 3 1 0];
y = [0 0 2 4 4 2];
z = [0 0 0 0 0 0];
figure();
hold on
patch(x,y,z,'cyan','FaceAlpha',0.3)
patch(x+2,y,z,'magenta','FaceAlpha',0.3)
patch(x+1,y+2,z,'yellow','FaceAlpha',0.3)

See also

History

Version
Description

1.0.0

initial version

1.7.0

CreateFcn, DeleteFcn callback added.

--

BeingDeleted property added.

Author

Allan CORNET

PreviousparulaNextpcolor

Last updated 8 months ago

Was this helpful?

, .

surf
colormap