OPDFanChart
R2026bDescription
Add-On Required: This feature requires the Optical Design and Simulation Library for Image Processing Toolbox add-on.
An OPDFanChart object stores information used to display a fan
chart of the tangential and sagittal optical path difference (OPD) wavefront error. You
can change aspects of the display, such as the title, line color, legend, and grid, by
modifying properties of the OPDFanChart object.
Creation
Create an OPDFanChart object by using the show
function with an OPD object
and the Style argument set to "fan".
Properties
OPD results, specified as an N-by-M array
of OPD
objects. N is the number of field points and
M is the number of wavelengths for which OPD has been
computed.
This property is read-only.
OPD fan data, in waves, represented as an N-by-M structure array. N is the number of field points and M is the number of wavelengths for which OPD has been computed. Each structure contains these fields:
PupilCoordinates— numPointsPerAxis-by-1 vector representing normalized coordinates along the tangential or sagittal axis of the entrance pupil. numPointsPerAxis is the number of uniformly spaced sample points along the tangential or sagittal axis of a single pupil, used to compute each OPD fan.Tangential— Tangential OPD fan values, in waves.Sagittal— Sagittal OPD fan values, in waves.
Chart title, specified as a string scalar or character vector.
Data Types: char | string
Line color, specified as an RGB triplet, a hexadecimal color code, or a color name. You can also specify multiple colors as an M-by-3 numeric matrix where each row is an RGB triplet, or as an M-element string vector where each element is a hexadecimal color code or color name. If you specify a single color, the chart displays all results using the same color. If you specify multiple colors, then M must be equal to the number of wavelengths.
For a custom color, specify an RGB triplet or a hexadecimal color code.
An RGB triplet is a three-element row vector whose elements specify the intensities of the red, green, and blue components of the color. The intensities must be in the range
[0,1], for example,[0.4 0.6 0.7].A hexadecimal color code is a string scalar or character vector that starts with a hash symbol (
#) followed by three or six hexadecimal digits, which can range from0toF. The values are not case sensitive. Therefore, the color codes"#FF8800","#ff8800","#F80", and"#f80"are equivalent.
Alternatively, you can specify some common colors by name. This table lists the named color options, the equivalent RGB triplets, and the hexadecimal color codes.
| Color Name | Short Name | RGB Triplet | Hexadecimal Color Code | Appearance |
|---|---|---|---|---|
"red" | "r" | [1 0 0] | "#FF0000" |
|
"green" | "g" | [0 1 0] | "#00FF00" |
|
"blue" | "b" | [0 0 1] | "#0000FF" |
|
"cyan"
| "c" | [0 1 1] | "#00FFFF" |
|
"magenta" | "m" | [1 0 1] | "#FF00FF" |
|
"yellow" | "y" | [1 1 0] | "#FFFF00" |
|
"black" | "k" | [0 0 0] | "#000000" |
|
"white" | "w" | [1 1 1] | "#FFFFFF" |
|
Example: Color="r"
Example: Color="green"
Example: Color=[0 0.4470 0.7410]
Legend display, specified as "on" or "off", or
as numeric or logical 1 (true) or
0 (false). A value of "on"
is equivalent to true, and "off" is equivalent to
false. The value is stored as an on/off logical value of type
matlab.lang.OnOffSwitchState.
Grid lines to display, specified as one of these options.
"major"— The chart displays only major grid lines."minor"— The chart displays major and minor grid lines."off"— The chart does not display any grid lines.
Data Types: char | string
Parent UI container, specified as a Figure object,
Panel object, GridLayout object,
Tab object, or TiledChartLayout object. If you
do not specify this property, MATLAB creates a new figure. You can create these UI
containers using their respective creation functions.
UI Figure:
uifigureUI Panel:
uipanelUI Grid Layout:
uigridlayoutUI Tab:
uitabTiled Chart Layout:
tiledlayout
Examples
Import a double Gauss lens optical system from a ZMX file into the workspace.
opsys = zmximport("DoubleGaussLens.zmx");Create a hexapolar sampling grid.
sg = samplingGrid("Hexapolar",30);Trace rays through the optical system.
rb = traceRays(opsys,SamplingGrid=sg);
Compute the OPD using data from the ray bundle.
opdr = opd(opsys,rb);
Display the OPD results as a fan chart.
hfan = show(opdr,Legend="off"); title("Wavefront Error")

More About
For each field point, the chart contains side-by-side axes for the tangential and sagittal OPD wavefront error. Each axes displays the OPD fans for all corresponding wavelengths.
Version History
Introduced in R2026b
See Also
opd | OPD | OPDMapChart | opticalSystem | fieldPoint
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.
Seleccione un país/idioma
Seleccione un país/idioma para obtener contenido traducido, si está disponible, y ver eventos y ofertas de productos y servicios locales. Según su ubicación geográfica, recomendamos que seleccione: .
También puede seleccionar uno de estos países/idiomas:
Cómo obtener el mejor rendimiento
Seleccione China (en idioma chino o inglés) para obtener el mejor rendimiento. Los sitios web de otros países no están optimizados para ser accedidos desde su ubicación geográfica.
América
- América Latina (Español)
- Canada (English)
- United States (English)
Europa
- 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)