pdegplot
Plot PDE geometry
Description
Examples
Plot 2-D Geometry with and Without Labels
Plot the geometry of a region defined by a few simple shapes.
g = [2 1 1 1 1 1 1 1 1 4 4; -1 -0.6 -0.5 -0.4 -0.5 0.4 0.5 0.6 0.5 -1 0.17; 1 -0.5 -0.4 -0.5 -0.6 0.5 0.6 0.5 0.4 0.17 1; 0 -0.25 -0.35 -0.25 -0.15 -0.25 -0.35 -0.25 -0.15 0 -0.74; 0 -0.35 -0.25 -0.15 -0.25 -0.35 -0.25 -0.15 -0.25 -0.74 0; 0 0 0 0 0 0 0 0 0 1 1; 1 1 1 1 1 1 1 1 1 0 0; 0 -0.5 -0.5 -0.5 -0.5 0.5 0.5 0.5 0.5 0 0; 0 -0.25 -0.25 -0.25 -0.25 -0.25 -0.25 -0.25 -0.25 0 0; 0 0.1 0.1 0.1 0.1 0.1 0.1 0.1 0.1 1 1; 0 0 0 0 0 0 0 0 0 0.75 0.75; 0 0 0 0 0 0 0 0 0 0 0]; pdegplot(g)
View the vertex labels, edge labels, and the face label. Add space at the top of the plot to see the top edge clearly.
pdegplot(g,"VertexLabels","on","EdgeLabels","on","FaceLabels","on") ylim([-.8,.1])
Plot 3-D Geometry
Import a 3-D geometry file. Plot the geometry and turn on face labels. To see the labels on all faces of the geometry, set the transparency to 0.5.
model = createpde; importGeometry(model,"BracketWithHole.stl"); pdegplot(model,"FaceLabels","on","FaceAlpha",0.5)
Plot Multi-Cellular 3-D Geometry
Import a 3-D geometry file. Plot the geometry and turn on cell labels.
model = createpde; importGeometry(model,"DampingMounts.stl"); pdegplot(model,"CellLabels","on")
Input Arguments
g
— Geometry description
femodel
object | fegeometry
object | PDEModel
object | DiscreteGeometry
object | AnalyticGeometry
object | output of decsg
| decomposed geometry matrix | name of geometry file | function handle to geometry file
Geometry description, specified by one of the following:
femodel
objectfegeometry
objectPDEModel
objectDiscreteGeometry
object (see DiscreteGeometry Properties)AnalyticGeometry
object (see AnalyticGeometry Properties)Output of
decsg
Decomposed geometry matrix (see Decomposed Geometry Data Structure)
Name of geometry file (see Parametrized Function for 2-D Geometry Creation)
Function handle to geometry file (see Parametrized Function for 2-D Geometry Creation)
Data Types: double
| char
| string
| function_handle
Name-Value Arguments
Specify optional pairs of arguments as
Name1=Value1,...,NameN=ValueN
, where Name
is
the argument name and Value
is the corresponding value.
Name-value arguments must appear after other arguments, but the order of the
pairs does not matter.
Before R2021a, use commas to separate each name and value, and enclose
Name
in quotes.
Example: pdegplot(g,"FaceLabels","on")
The argument SubdomainLabels
is not recommended.
Use FaceLabels
for both 2-D and 3-D geometries
instead.
VertexLabels
— Vertex labels for 2-D or 3-D geometry
"off"
(default) | "on"
Vertex labels for 2-D or 3-D geometry, specified as "off"
or
"on"
.
Example: "VertexLabels","on"
Data Types: char
| string
EdgeLabels
— Boundary edge labels for 2-D or 3-D geometry
"off"
(default) | "on"
Boundary edge labels for 2-D or 3-D geometry, specified as "off"
or
"on"
.
Example: "EdgeLabels","on"
Data Types: char
| string
FaceLabels
— Boundary face labels for 2-D or 3-D geometry
"off"
(default) | "on"
Boundary face labels for 2-D or 3-D geometry, specified as "off"
or
"on"
.
Example: "FaceLabels","on"
Data Types: char
| string
CellLabels
— Cell labels for 3-D geometry
"off"
(default) | "on"
Cell labels for 3-D geometry, specified as "off"
or
"on"
.
Example: "CellLabels","on"
Data Types: char
| string
FaceAlpha
— Surface transparency for 3-D geometry
1
(default) | real number from 0
through 1
Surface transparency for 3-D geometry, specified as a real number from 0
through 1
. The default value 1
indicates no
transparency. The value 0
indicates complete transparency.
Example: FaceAlpha=0.5
Data Types: double
Output Arguments
h
— Handles to graphics objects
vector
Handles to graphics objects, returned as a vector.
Alternative Functionality
App
If you create 2-D geometry in the PDE Modeler app, you can view the geometry from Boundary Mode. To see the edge labels, select Boundary > Show Edge Labels. To see the face labels, select PDE > Show Subdomain Labels.
Version History
Introduced before R2006aR2023a: Finite element geometry support
pdegplot
now plots geometries specified by fegeometry
and femodel
objects.
R2020a: Improved performance for plots with many text labels
pdegplot
shows faster rendering and better responsiveness for
plots that display many text labels. Code containing
findobj(fig,'Type','Text')
no longer returns labels on
figures produced by pdegplot
.
R2016b: Transparency, vertex and cell labels
You can now set plot transparency by using FaceAlpha
, and
display vertex and cell labels by using VertexLabels
and
CellLabels
, respectively.
The argument SubdomainLabels
is no longer recommended. Use
FaceLabels
for 2-D geometries instead.
R2012b: Edge and subdomain labels
Display edge and subdomain labels by setting edgeLabels
or
subdomainLabels
to 'on'
.
Abrir ejemplo
Tiene una versión modificada de este ejemplo. ¿Desea abrir este ejemplo con sus modificaciones?
Comando de MATLAB
Ha hecho clic en un enlace que corresponde a este comando de MATLAB:
Ejecute el comando introduciéndolo en la ventana de comandos de MATLAB. Los navegadores web no admiten comandos de MATLAB.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)