Contenido principal

plot

R2026b

Plot ray paths in 3D scenario viewer

Since R2026b

    Description

    Add-On Required: This feature requires the 3D Scenarios add-on.

    pathvis = plot(raypath) plots the specified ray paths in the current viewer and returns one or more visual objects.

    pathvis = plot(v,raypath) plots the ray paths in the specified viewer.

    Input Arguments

    collapse all

    Ray paths, specified as a vector of RayPath objects or a vector of RayPathSet objects. You can also specify a scalar object.

    Viewer, specified as a GlobeViewer object.

    Name-Value Arguments

    collapse all

    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.

    Example: plot(v,raypath,LineWidth=7) specifies the width of the lines that make up the ray paths.

    Specify properties of the visual object using name-value arguments. The supported name-value arguments depends on the type of input.

    Type of InputSupported Name-Value Arguments
    raypath contains RayPath objectsSee the RayPathVisual object.
    raypath contains RayPathSet objectsSee the RayTraceVisual object.

    When raypath contains RayPath objects, you can also set these name-value arguments that do not have matching properties on the RayPathVisual object. The function uses the ColorMetric, Colormap, and ColorLimits arguments to set the Color property of the RayPathVisual object.

    Metric for the ray path colors, specified as one of these values:

    • "num-interactions" — Apply color to the ray paths based on the number of interactions. By default, the plot object sets the color limits to the minimum and maximum number of interactions, and the number of interactions map directly to colors in the colormap.

    • "distance" — Apply color to the ray paths based on the propagation distance.

      When raypath contains RayPath objects, the function uses this argument to set the Color property of the RayPathVisual object. Specifying both ColorMetric and Color is not supported.

    Colormap for the ray paths, specified as an m-by-3 array of RGB triplets that define m individual colors or as a colormap name from this table.

    Colormap NameColor Scale

    parula

    Colorbar showing the colors of the parula colormap. The colormap starts at dark blue and transitions to lighter blue, green, orange and yellow. The transitions between colors are more perceptually uniform than in most other colormaps.

    turbo

    Colorbar showing the colors of the turbo colormap. The colormap starts at dark blue and transitions to lighter blue, bright green, orange, yellow, and dark red. This colormap is similar to jet, but the transitions between colors are more perceptually uniform than in jet.

    hsv

    Colorbar showing the colors of the hsv colormap. The colormap starts at red and transitions to yellow, bright green, cyan, dark blue, magenta, and bright orange.

    hot

    Colorbar showing the colors of the hot colormap. The colormap starts at dark red and transitions to bright red, orange, yellow, and white.

    cool

    Colorbar showing the colors of the cool colormap. The colormap starts at cyan and transitions to light blue, light purple, and magenta.

    spring

    Colorbar showing the colors of the spring colormap. The colormap starts at magenta and transitions to pink, light orange, and yellow.

    summer

    Colorbar showing the colors of the summer colormap. The colormap starts at medium green and transitions to yellow.

    autumn

    Colorbar showing the colors of the autumn colormap. The colormap starts at bright orange and transitions to yellow.

    winter

    Colorbar showing the colors of the winter colormap. The colormap starts at dark blue and transitions to bright green.

    gray

    Colorbar showing the gray colormap. The colormap starts at black and transitions to white.

    bone

    Colorbar showing the bone colormap. This colormap has colors that are approximately gray with a slight blue color tint. The colormap starts at dark gray and transitions to white.

    copper

    Colorbar showing the copper colormap. This colormap starts at black and transitions to a medium orange, similar to the color of copper.

    pink

    Colorbar showing the pink colormap. This colormap starts at dark red and transitions to dark pink, tan, and white.

    sky (since R2023a)

    Colorbar showing the sky colormap. This colormap starts at a very light shade of blue and transitions to a darker shade of blue.

    abyss (since R2023b)

    Colorbar showing the abyss colormap. This colormap starts at a very dark shade of blue and transitions to a lighter shade of blue.

    nebula (since R2025a)

    Colorbar showing the nebula colormap. This colormap starts at a medium shade of blue and transitions to a bright shade of red.

    jet

    Colorbar showing the colors of the jet colormap. The colormap starts at dark blue and transitions to light blue, bright green, orange, yellow, and dark red.

    lines

    Colorbar showing the colors of the lines colormap. The colormap contains a repeating pattern of colors: dark blue, dark orange, dark yellow, dark purple, medium green, light blue, and dark red.

    colorcube

    Colorbar showing the colors of the colorcube colormap. The colormap is a course sampling of the RGB colorspace.

    prism

    Colorbar showing the colors of the prism colormap. The colormap contains a repeating pattern of colors: red, orange, yellow, green, blue, and purple.

    flag

    Colorbar showing the colors of the flag colormap. The colormap contains a repeating pattern of colors: red, white, blue, and black.

    white

    Colorbar showing the white colormap, which is entirely white.

    When raypath contains RayPath objects, the function uses this argument to set the Color property of the RayPathVisual object. Specifying both Colormap and Color is not supported.

    Color limits for the ray paths, specified as a two-element vector of the form [cmin cmax]. This property determines how data values map to the colors in the colormap, where:

    • cmin specifies the data value that maps to the first color in the colormap.

    • cmax specifies the data value that maps to the last color in the colormap.

    The plot object interpolates data values between cmin and cmax across the colormap. Values outside this range use either the first or last color, whichever is closest.

    When raypath contains RayPath objects, the function uses this argument to set the Color property of the RayPathVisual object. Specifying both ColorLimits and Color is not supported.

    Option to show the color legend, 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. Thus, you can use the value of this property as a logical value. The value is stored as an on/off logical value of type matlab.lang.OnOffSwitchState.

    • "on" — Show the color legend.

    • "off" — Do not show the color legend.

    The viewer can display a maximum of one legend at a time.

    Output Arguments

    collapse all

    Ray path visual, returned as one of these options:

    The size of pathvis matches the size of raypath.

    Version History

    Introduced in R2026b