Documentation

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

Legend

Makes a legend entry

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.

Value Summary

Library wrapper for “LegendText, LegendEntry, and LegendVisibleSee below

Description

Legend makes a legend entry and activates the legend.

Legend is a library wrapper which sets a LegendText and simultaneously switches the legend on by setting LegendEntry and LegendVisible to TRUE.

Examples

Example 1

Legend is used to set a LegendText for the function and activate the legend. The line does not appear in the legend:

plot(plot::Function2d(cos(x), x = 0..2*PI, Legend = "cos(x)"),
     plot::Line2d([0, 1], [4, cos(4)], Color = RGB::Black))

Was this topic helpful?