Solid, dashed or dotted lines?

MuPAD® notebooks will be removed in a future release. Use MATLAB® live scripts instead.

MATLAB live scripts support most MuPAD functionality, though there are some differences. For more information, see Convert MuPAD Notebooks to MATLAB Live Scripts.

Value Summary

InheritedDashed, Dotted, or Solid


LineStyle controls whether lines are drawn as solid, dashed or dotted lines.

LineStyle sets the style of line objects such as 2D function graphs, curves in 2D and 3D, arrows, parameter lines on surfaces etc.

The available line styles are Solid, Dashed, or Dotted.

This attribute may be useful to distinguish different curves.

LineStyle does not have an effect on the line style of axes and coordinate grid lines. Axes are always displayed as solid lines. The style of the coordinate grid can be set by the attribute GridLineStyle.


Example 1

We draw a dashed parabola:

plot(plot::Function2d(x^2, x = -2..5, LineStyle = Dashed))

We draw a paraboloid with dashed coordinate lines:

plot(plot::Function3d(x^2 + y^2, x = -2..5, y = -2..5, 
                      Mesh = [8, 8], Submesh = [3, 3],
                      LineStyle = Dashed))