pdegplot
Plot PDE geometry
Description
pdegplot(
plots with additional options specified by one or more name-value arguments. For
example, you can specify whether to display vertex, edge, face, and cell
labels.g
,Name,Value
)
returns
handles to the graphics, using any of the previous syntaxes.h
= pdegplot(___)
Examples
Plot 2-D Geometry
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.
gm = fegeometry("BracketWithHole.stl"); pdegplot(gm,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.
gm = fegeometry("DampingMounts.stl"); pdegplot(gm,CellLabels="on")
Lighting Effects on 3-D Plots
Since R2023b
Create and plot a 3-D geometry consisting of three nested cuboids of the same height. By default, pdegplot
uses lighting effects to display geometric features, like different cells, with more contrast.
gm = multicuboid([2 3 5],[4 6 10],3);
pdegplot(gm,CellLabels="on",FaceAlpha=0.3)
To obtain the same plot appearance as in R2023a or earlier, turn off the lighting effects.
figure pdegplot(gm,CellLabels="on",FaceAlpha=0.3,Lighting="off")
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 these values:
femodel
objectfegeometry
objectPDEModel
objectDiscreteGeometry
objectAnalyticGeometry
objectOutput 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")
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"
.
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"
.
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"
.
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"
.
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
Lighting
— Lighting effects for 3-D geometry
"on"
(default) | "off"
Since R2023b
Lighting effects for 3-D geometry, specified as
"on"
or "off"
.
Data Types: char
| string
Output Arguments
h
— Handles to graphics objects
vector
Handles to graphics objects, returned as a vector.
Alternative Functionality
App
If you create a 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 R2006aR2023b: Control lighting effects
pdegplot
now uses lighting effects by default to display
geometric features with more contrast. To obtain the same plot appearance as in the
previous releases, you can turn off lighting effects by setting the
Lighting
name-value argument to
"off"
.
R2023a: 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: Specify transparency, and display 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: Display edge and subdomain labels
Display edge and subdomain labels by setting EdgeLabels
or
SubdomainLabels
to 'on'
.
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
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)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)