Plot an imat_shp in a special figure window.
plot(s,fem)
[h,shpout]=plot(shp,fem,handle,format,complexdisplay,'noundeformed','title',titlestr,'scale',scalefactor,'silent','unitslabel',unitslab)
PLOT displays the mode shapes supplied in the imat_shp object SHP using the supplied IMAT_FEM object FEM. PLOT expects that FEM information is either an IMAT_FEM object, or as individual IMAT_NODE, IMAT_ELEM, IMAT_CS, and/or IMAT_TL objects. If node geometry is not in the global coordinate system, the coordinate system structure must be present so PLOT can transform the node coordinates. The input shape coefficients are assumed to be in the FEM's displacement coordinate system(s).
By default, both the undeformed and the deformed model will be displayed. The undeformed model will be drawn with '.' node markers and dashed lines ('--') for the elements and tracelines. The deformed model will be displayed with '.' node markers and solid lines for the elements and tracelines. Colors are determined by the FEM entity colors.
HANDLE is a figure or panel handle. If a figure handle is supplied, the shape will be displayed on the supplied figure after deleting the contents of the figure. If a panel handle is supplied, the shape will be displayed on the supplied panel after deleting the contents of the panel. If an axis handle is supplied, PLOT will create a uipanel on top of the axis, using its OuterPosition for location and sizing. It will place the shape plot in the uipanel.
FORMATSTRING is a string containing valid point and line styles. These follow MATLAB PLOT() conventions, and will be applied to the deformed geometry.
Other valid display and format arguments and their descriptions are shown in the table below.
General Options | |
'noundeformed' | Turn off undeformed display. |
'nodeformed' | Turn off deformed display. |
'cycleshapes' | When animating, cycle through each shape. This is useful for animating transient results. |
'title' | Must be followed by a string containing the figure title. |
'unitslabel' |
This must be followed by a string containing the units label that will be placed in parentheses after the axis label. Pass in a space (' ') to disable the units label. Note that if 'unitslabel' is not supplied, and the OrdinateUnitsLab of the supplied SHP is not empty, the label on the first shape will be used instead. |
'scale' | Scale factor by which to multiply the default deformed display amplitude. |
'jpeg' | Use Motion JPEG AVI compression for AVI file creation (default). |
'nocompression' | Turn off compression for AVI file creation. |
'animate' | Animate the shape as soon as the figure is created. |
'silent' | Do not print progress messages when displaying the shape. |
'nogui' | Removes all buttons on plot window. |
'noidlines' | Removes ID Line information from plot area. |
'noaxes' | Turns off the axis display |
'names' | This must be followed by a cell array of strings the same length as the total number of shapes to be plotted. The strings will replace the 'Mode #' text in the upper left of the plot window. If a single string is passed in, it will be used for all of the modes. |
'colormag' | Colors elements based on shape magnitude. |
'colormask' |
1x3 boolean vector to specify whether X, Y, and Z components are included in the color calculation. To color by magnitude (default), turn on all three. |
'staticcolor' | Do not recalculate colors during animation. |
'noscaleshapes' | Apply the shape coefficients to the deformation without scaling them. By default, the shape coefficients are normalized to be relative to the FEM extents. |
'loop' | Logical specifying whether the shape animation should loop.Defaults to false for transient plots. Defaults to true for all others. |
'reversex' | Reverse the X- and Z-axis directions. You cannot use more than one reverse axis option at a time. |
'reversey' | Reverse the X- and Y-axis directions. You cannot use more than one reverse axis option at a time. |
'reversez' | Reverse the Y- and Z-axis directions. You cannot use more than one reverse axis option at a time. |
'backgroundcolor',COLOR | Set the panel's background color. You can pass in a string or a 1x3 numeric RGB vector. |
'textcolor',COLOR | Set the title text and axis color. You can pass in a string or a 1x3 numeric RGB vector. |
Complex Display Options | |
'real' | Display the real portion of the complex mode shape. |
'imag' | Display the imaginary portion of the complex mode shape. |
'amp' | Display the shape coefficients as a signed amplitude (default). |
'complex' | Display the shape coefficients as a complex shape. The static display is a signed amplitude, but the animation displays as complex (i.e. each node hits its maximum amplitude at different points in time). |
Formatting arguments passed in to the PLOT command only apply to the deformed shape. You have much more control over the node, element, and traceline formats through the pulldown menus available on the figure.
Several pulldown menus will appear on the PLOT figure. In addition to the pulldowns drawn with imat_fem/plot, a pulldown menu called Shape will appear. This menu allows you to toggle the title display, change the complex shape display option, change the deformed geometry scale, edit the shape's ID lines, and change the animation speed. In addition, pushbuttons for starting and stopping animation and closing the figure appear at the bottom of the figure window.
You can also create an AVI animation of the current shape through the Shape pulldown menu. You have the option of compressing the image using the Motion JPEG AVI CODEC (the default) or creating an uncompressed file. To create an AVI file, select your compression option, then select Create AVI on Animate. The next time you press the Animate button, you will be prompted for an AVI filename. The first cycle of animation will create the AVI file. After the file has been created, animation will continue.
Please note that if you want to retrieve the updated imat_shp with modified ID lines, you need to request both output arguments. In this case PLOT will retain program control until you close the figure.
If you pass in an imat_shp with multiple shapes, three additional buttons will appear at the bottom of the figure. These allow you to cycle to the previous or next shape, or select a shape to plot.
Please note that performance is slow for large models. For large models, consider using VTKPLOT.
>> plot(s(1),fem)
Plotting undeformed shape
Plotting deformed shape
>> plot(s(1),fem,'real','*-.','silent')
>> plot(s(1),fem,'real','*-.','silent','scale',2) % Double deformations
>> h=plot(fem);
>> plot(s(1),fem,h,'noundef','*-.','title','This is the title')
Plotting deformed shape