sectorplotoptions
Create list of relative index plot options
Description
Use the sectorplotoptions
function to create a
SectorPlotOptions
object. Use this object to customize the appearance of a
Nichols plot created using sectorplot
or passiveplot
and override the plot preferences for the MATLAB® session in which you create the Nichols plot.
Creation
Description
returns a
default set of plot options for use with the plotoptions
= sectorplotoptionssectorplot
and
passiveplot
commands. You can use these options to customize the
plot appearance using the command line. This syntax is useful when you want to write a
script to generate plots that look the same regardless of the preference settings of the
MATLAB session in which you run the script.
initializes the plot options with the options you selected in the Control System Toolbox™ Preferences Editor. For more information about the editor, see Specify Toolbox Preferences for Linear Analysis Plots. This syntax is useful when you want to change a few
plot options but otherwise use your default preferences. A script that uses this syntax
can generate results that look different when run in a session with different
preferences.plotoptions
= sectorplotptions("cstprefs")
Properties
Units and Scaling
FreqUnits
— Frequency units
'rad/s'
(default) | 'Hz'
| 'rpm'
| 'auto'
| ...
Frequency units, specified as one of the following values:
'Hz'
'rad/s'
'rpm'
'kHz'
'MHz'
'GHz'
'rad/nanosecond'
'rad/microsecond'
'rad/millisecond'
'rad/minute'
'rad/hour'
'rad/day'
'rad/week'
'rad/month'
'rad/year'
'cycles/nanosecond'
'cycles/microsecond'
'cycles/millisecond'
'cycles/hour'
'cycles/day'
'cycles/week'
'cycles/month'
'cycles/year'
You can also specify 'auto'
which uses frequency
'rad/TimeUnit'
, where TimeUnit
is the
TimeUnit
property of the input system.
FreqScale
— Frequency scale
'log'
(default) | 'linear'
Frequency scale, specified as either 'log'
or
'linear'
.
IndexScale
— Index scale
'log'
(default) | 'linear'
Index scale, specified as either 'log'
or
'linear'
.
Title and Axis Labels
Title
— Title text and style
structure
Title text and style, specified as a structure with the following fields:
String
— Label text, specified as a character vector. By default, the plot is titled 'Bode Diagram'.FontSize
— Font size, specified as a scalar value greater than zero in point units. The default font size depends on the specific operating system and locale. One point equals1/72
inch.FontWeight
— Character thickness, specified as'Normal'
or'bold'
. MATLAB uses theFontWeight
property to select a font from those available on your system. Not all fonts have a bold weight. Therefore, specifying a bold font weight can still result in the normal font weight.FontAngle
— Character slant, specified as'Normal'
or'italic'
. Not all fonts have both font styles. Therefore, the italic font might look the same as the normal font.Color
— Text color, specified as an RGB triplet. The default color is black specified by the RGB triplet[0,0,0]
.Interpreter
— Text interpreter, specified as one of these values:'tex'
— Interpret characters using a subset of TeX markup. This is the default value ofInterpreter
.'latex'
— Interpret characters using LaTeX markup.'none'
— Display literal characters.
XLabel
— X-axis label text and style
structure
X-axis label text and style, specified as a structure with the following fields:
String
— Label text, specified as a character vector. By default, the axis is titled based on the frequency unitsFreqUnits
.FontSize
— Font size, specified as a scalar value greater than zero in point units. The default font size depends on the specific operating system and locale. One point equals1/72
inch.FontWeight
— Character thickness, specified as'Normal'
or'bold'
. MATLAB uses theFontWeight
property to select a font from those available on your system. Not all fonts have a bold weight. Therefore, specifying a bold font weight can still result in the normal font weight.FontAngle
— Character slant, specified as'Normal'
or'italic'
. Not all fonts have both font styles. Therefore, the italic font might look the same as the normal font.Color
— Text color, specified as an RGB triplet. The default color is black specified by the RGB triplet[0,0,0]
.Interpreter
— Text interpreter, specified as one of these values:'tex'
— Interpret characters using a subset of TeX markup. This is the default value ofInterpreter
.'latex'
— Interpret characters using LaTeX markup.'none'
— Display literal characters.
YLabel
— Y-axis label text and style
structure
Y-axis label text and style, specified as a structure with the following fields:
String
— Label text, specified as a cell array of character vectors. By default, the axis label is a 1x2 cell array with 'Magnitude' and 'Phase'.FontSize
— Font size, specified as a scalar value greater than zero in point units. The default font size depends on the specific operating system and locale. One point equals1/72
inch.FontWeight
— Character thickness, specified as'Normal'
or'bold'
. MATLAB uses theFontWeight
property to select a font from those available on your system. Not all fonts have a bold weight. Therefore, specifying a bold font weight can still result in the normal font weight.FontAngle
— Character slant, specified as'Normal'
or'italic'
. Not all fonts have both font styles. Therefore, the italic font might look the same as the normal font.Color
— Text color, specified as an RGB triplet. The default color is black specified by the RGB triplet[0,0,0]
.Interpreter
— Text interpreter, specified as one of these values:'tex'
— Interpret characters using a subset of TeX markup. This is the default value ofInterpreter
.'latex'
— Interpret characters using LaTeX markup.'none'
— Display literal characters.
TickLabel
— Tick label style
structure
Tick label style, specified as a structure with the following fields:
FontSize
— Font size, specified as a scalar value greater than zero in point units. The default font size depends on the specific operating system and locale. One point equals1/72
inch.FontWeight
— Character thickness, specified as'Normal'
or'bold'
. MATLAB uses theFontWeight
property to select a font from those available on your system. Not all fonts have a bold weight. Therefore, specifying a bold font weight can still result in the normal font weight.FontAngle
— Character slant, specified as'Normal'
or'italic'
. Not all fonts have both font styles. Therefore, the italic font might look the same as the normal font.Color
— Text color, specified as an RGB triplet. The default color is black specified by the RGB triplet[0,0,0]
.
Grid
Grid
— Toggle grid display
'off'
(default) | 'on'
Toggle grid display on the plot, specified as either 'off
' or
'on
'.
GridColor
— Color of the grid lines
[0.15 0.15 0.15]
(default) | RGB triplet
Color of the grid lines, specified as an RGB triplet. The default color is light
grey specified by the RGB triplet [0.15 0.15 0.15]
.
Axis Limits
XLimMode
— X-axis limit selection mode
'auto'
(default) | 'manual'
| cell array
X-axis limit selection mode, specified as one of the following values:
'auto'
— Enable automatic limit selection, which is based on the total span of the plotted data.'manual'
— Manually specify the axis limits. To specify the axis limits, set theXLim
option.
YLimMode
— Y-axis limit selection mode
'auto'
(default) | 'manual'
| cell array
Selection mode for the y-axis limits, specified as one of these values:
'auto'
— Enable automatic limit selection, which is based on the total span of the plotted data.'manual'
— Manually specify the axis limits. To specify the axis limits, set theYLim
option.
XLim
— X-axis limits
'{[1,10]}'
(default) | cell array of two-element vectors of the form
[min,max]
| cell array
X-axis limits, specified as a cell array of two-element vector of the form
[min,max]
.
YLim
— Y-axis limits
'{[1,10]}'
(default) | cell array of two-element vector of the form [min,max]
| cell array
Y-axis limits, specified as a cell array of two-element vector of the form
[min,max]
.
Object Functions
passiveplot | Compute or plot passivity index as function of frequency |
sectorplot | Compute or plot sector index as function of frequency |
Examples
Custom Passivity Index Plot Settings Independent of Preferences
For this example, create a passivity index plot that uses 15-point red text for the title. This plot looks the same in any MATLAB® session, regardless of the preferences of the one in which it is generated.
First, create a default options set using sectorplotoptions
.
plotoptions = sectorplotoptions;
Next, change the required properties of the options set plotoptions
.
plotoptions.Title.FontSize = 15; plotoptions.Title.Color = [1 0 0]; plotoptions.FreqUnits = 'Hz'; plotoptions.Grid = 'on';
Now, create a passivity index plot using the options set plotoptions.
G = tf(1,[1 1]); passiveplot(G,plotoptions)
Because plotoptions
begins with a fixed set of options, the plot result is independent of the toolbox preferences of the current MATLAB session.
Customized Sector Plot of Model with Complex Coefficients
For this example, create a relative sector plot of a model with complex coefficients. Then, turn the grid on, rename the plot, and change the frequency scale.
Create a state space model with complex data and specify a sector geometry.
A = [-3.50,-1.25-0.25i;2,0]; B = [1;0]; C = [-0.75-0.5i,0.625-0.125i]; D = 0.5; Hc = [ss(A,B,C,D);1]; Q = [1 0.1;0.1 -1];
Create an options set based on the toolbox preferences.
plotoptions = sectorplotoptions('cstprefs'); plotoptions.Grid = 'on'; plotoptions.FreqScale = 'linear'; plotoptions.Title.String = 'Relative Sector Index Plot of Complex-Coefficient Model';
Now, create a sector plot with custom option set plotoptions
.
sectorplot(Hc,Q,plotoptions)
Version History
Introduced in R2016a
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)