Legend at left, center, or right
MuPAD® notebooks are not recommended. 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.
LegendVisible activates a legend identifying
the individual objects in a plot.
the placement of this legend.
For complex plots with multiple objects, it is often helpful to include an explanation in form of a legend that states the connection from object color to object meaning.
LegendPlacement, the legend can be
moved from below the plot to above it.
whether the legend is displayed flush left, flush right, or centered
(which is the default).
It is possible to explicitly switch this automatic legend off:
plotfunc2d(sin(x), cos(x), LegendVisible = FALSE)
we place the legend in the upper right corner of the graphics:
plotfunc2d(sin(x), cos(x), LegendPlacement = Top, LegendAlignment = Right)
When plotting many objects with active legend entries, the legend is abbreviated: It will never take up more than half of the scene height and it will not contain more than 20 entries:
plotfunc2d(-i*x^3+i/10*x^2+x-i $ i = -15..15, x=-1..1)
plotfunc2d(-i*x^3+i/10*x^2+x-i $ i = -15..15, x=-1..1, Height = 15*unit::cm)