Nelson banner
Graphics functions

The graphics module provides functions for creating, customizing, and managing plots, figures, colormaps, and graphical objects.

It includes 2-D and 3-D visualization, user interaction tools (zoom, pan, rotate), and utilities for working with colors, legends, axes, and text annotations.

2-D and 3-D Plots

Functions grouped by visualization type, including lines, distributions, discrete data, polar plots, contours, vector fields, surfaces, volumes, polygons, and animation.

Line Plots

Functions for line plots, function plots, and plots with error bars.

  • errorbar
    Plot data with error bars.
  • fplot
    Plot an expression or parametric function.
  • fplot3
    Plot a 3-D parametric curve from function handles.
  • line
    Create primitive line.
  • loglog
    Log-log scale plot.
  • plot
    Linear 2-D plot.
  • plot3
    3-D line plot.
  • semilogx
    Semilog plot (x-axis has log scale).
  • semilogy
    Semilog plot (y-axis has log scale).
  • xline
    Vertical constant line.
  • yline
    Horizontal constant line.
Polar Plots

Functions for creating and configuring polar plots.

Contour Plots

Functions for contour computation, contour plots, and contour labels.

Data Distribution Plots

Functions for histograms, scatter plots, distribution charts, and data summary visualizations.

Vector Fields

Functions for vector fields and stream visualizations.

  • compass
    Display arrows from the origin on a polar grid.
  • compassplot
    Display vectors from the origin in polar coordinates.
  • coneplot
    Display 3-D vector directions with cone-style arrows.
  • feather
    Display vectors from a baseline.
  • quiver
    2-D vector field plot.
  • quiver3
    3-D vector field plot.
  • stream2
    Compute 2-D streamline vertices from vector field data.
  • stream3
    Compute 3-D streamline vertices from vector field data.
  • streamline
    Display streamlines from vector field data.
  • streamparticles
    Display particle markers along stream paths.
  • streamribbon
    Display stream paths with ribbon-like line styling.
  • streamslice
    Display vector field direction on a slice or plane.
  • streamtube
    Display stream paths with tube-like line styling.
Discrete Data Plots

Functions for bar charts, stem plots, pie charts, and other discrete data displays.

  • bar
    Bar graph.
  • bar3
    Display a 3-D vertical bar chart.
  • bar3h
    Display a 3-D horizontal bar chart.
  • barh
    Horizontal bar graph.
  • donutchart
    Donut chart object.
  • pareto
    Display Pareto chart.
  • pie
    Legacy pie chart.
  • piechart
    Pie chart object.
  • stairs
    Stairstep graph.
  • stem
    Plot discrete sequence data.
  • stem3
    Display 3-D stem plot.
Surfaces, Volumes, and Polygons

Functions for surfaces, meshes, volumes, filled areas, and polygon graphics.

  • area
    Create area plots.
  • contourslice
    Display contour lines on slices through volume data.
  • cylinder
    Create cylinder.
  • fill
    Create filled 2-D patches.
  • fill3
    Create filled 3-D patches.
  • fimplicit
    Plot an implicit function curve.
  • fimplicit3
    Plot an implicit 3-D function surface approximation.
  • fmesh
    Plot a mesh from a function of two variables.
  • fsurf
    Plot a function surface.
  • isonormals
    Compute normals of isosurface vertices.
  • isosurface
    Extract isosurface data from volume data.
  • mesh
    Mesh surface plot.
  • meshc
    Display a mesh with contour lines below it.
  • meshz
    Mesh surface plot with curtain.
  • patch
    Create patches of colored polygons
  • pcolor
    Pseudocolor plot.
  • rectangle
    Create a rectangle with sharp, rounded or curved corners
  • ribbon
    Ribbon plot.
  • shrinkfaces
    Reduce patch face size.
  • slice
    Display orthogonal slices through volume data.
  • smooth3
    Smooth 3-D data.
  • sphere
    Create sphere.
  • surf
    surface plot.
  • surface
    Primitive surface plot.
  • surfc
    Display a surface with contour lines below it.
  • surfl
    Display a lighted surface.
  • surfnorm
    Compute or display surface normal vectors.
  • triplot
    2-D triangular plot
  • trisurf
    Triangular surface plot
  • waterfall
    waterfall plot.
Animation

Functions for animated plots and dynamic point updates.

    Graphics Objects

    Functions and reference pages for graphics object management, layout objects, user interface objects, and object properties.

    Graphics Object Management

    Functions for creating, finding, querying, clearing, and closing graphics objects.

    • allchild
      Return all direct children of graphics objects.
    • ancestor
      Ancestor of graphics object.
    • axes
      Create cartesian axes.
    • cla
      Clear axes.
    • clf
      Clear figure.
    • close
      Close one or more figures
    • figure
      Creates an figure window.
    • findall
      Find graphics objects, including hidden handles.
    • findobj
      Find graphics objects with specific properties.
    • gca
      get current axes graphics object.
    • gcf
      get current figure graphics object.
    • groot
      graphic root object.
    • hggroup
      Create group object.
    • hold
      Retain current plot when adding new plots.
    • is2D
      Checks if ax is a 2-D Polar or Cartesian axes.
    • isValidGraphicsProperty
      Check property name is valid.
    • isgraphics
      Check for graphics object.
    • ishold
      Get current hold state.
    • newplot
      Prepare to produce a new plot.
    Layout Objects

    Functions for arranging multiple plots and working with tiled layouts.

    • nexttile
      Create axes in tiled chart layout.
    • subplot
      Create axes in tiled positions.
    • tiledlayout
      Create tiled chart layout.
    • tilenum
      Get tile number from row-column indices or graphics object.
    • tilerowcol
      Get row and column indices from tile number or graphics object.
    User Interface Objects

    Functions for user interface controls, menus, and context menus.

    Graphics Object Properties

    Reference pages for visible graphics object properties, supported value types, and property actions.

      Labels and Styling

      Functions for labels, annotations, axes appearance, colors, interaction, camera views, and lighting.

      Axes Appearance

      Functions for axis limits, ticks, grids, boxes, and aspect ratios.

      • axis
        Set axis limits and aspect ratios.
      • box
        Display or hide graphics object outline.
      • daspect
        Control data unit length along each axis.
      • datetick
        Date formatted tick labels.
      • grid
        Display or hide axes grid lines.
      • pbaspect
        Control relative lengths of each axis in the plot box.
      • rlim
        Set or get radial limits for polar axes.
      • rticklabels
        Set or get radial tick labels for polar axes.
      • rticks
        Set or get radial tick values for polar axes.
      • thetalim
        Set or get angular limits for polar axes.
      • thetaticklabels
        Set or get angular tick labels for polar axes.
      • thetaticks
        Set or get angular tick values for polar axes.
      • xlim
        set or get x-axis limits.
      • xtickangle
        Rotate x-axis tick labels.
      • xtickformat
        Set or get the x-axis tick label format.
      • xticklabels
        Set or get x-axis tick labels.
      • xticks
        Set or get x-axis tick values.
      • ylim
        set or get y-axis limits.
      • ytickangle
        Rotate y-axis tick labels.
      • ytickformat
        Set or get the y-axis tick label format.
      • yticklabels
        Set or query y-axis tick labels.
      • yticks
        Set or get y-axis tick values.
      • yyaxis
        Create or select an axes with two y-axes.
      • zlim
        set or get z-axis limits.
      • ztickangle
        Rotate z-axis tick labels.
      • ztickformat
        Set or get the z-axis tick label format.
      • zticklabels
        Set or get z-axis tick labels.
      • zticks
        Set or get z-axis tick values.
      Color and Styling

      Functions for colors, colormaps, color limits, color order, and rendering style.

      Colormaps

      Functions for creating, selecting, and listing colormaps.

      • abyss
        Abyss colormap array.
      • autumn
        Autumn colormap array.
      • bone
        Bone colormap array.
      • colorcube
        Enhanced RGB color cube colormap array.
      • colormap
        View and set current colormap.
      • colormaplist
        Provide list of colormaps.
      • cool
        Cool colormap array.
      • copper
        Copper colormap array.
      • flag
        Flag colormap array.
      • gray
        Gray colormap array.
      • hot
        Hot colormap array.
      • hsv
        Hue-saturation-value colormap array.
      • jet
        Jet colormap array.
      • lines
        Line color order colormap array.
      • nebula
        Nebula colormap array.
      • parula
        Parula colormap array.
      • pink
        Pink colormap array.
      • prism
        Prism colormap array.
      • sky
        Sky colormap array.
      • spring
        Spring colormap array.
      • summer
        Summer colormap array.
      • turbo
        Turbo colormap array.
      • viridis
        Viridis colormap array.
      • white
        white colormap array.
      • winter
        Winter colormap array.
      Interactions, Camera Views, and Lighting

      Functions for interactive graphics, callbacks, camera views, and lighting.

      Labels and Annotations

      Functions for titles, axis labels, legends, color bars, text, and annotations.

      • caxis
        Query or set axes color limits.
      Images

      Functions for displaying images, converting frames, and playing recorded frames.

      • frame2im
        Retrieve image data from a movie frame.
      • getframe
        Capture figure or axes as movie frame.
      • im2frame
        Convert image to movie frame.
      • image
        Display image from array.
      • imagesc
        Display image from array with scaled colors.
      • imshow
        Display image.
      • movie
        Render recorded movie frames.
      Printing and Saving

      Functions for opening and saving figure files.

      • openfig
        Open a Nelson FIG file.
      • print
        Export a figure to an image or document file.
      • savefig
        Save figure to a Nelson FIG file.