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.

LegendEntry

Add this object to the legend?

Value Summary

InheritedFALSE, or TRUE

Description

LegendEntry turns legend entries of individual objects on and off, if LegendVisible is TRUE.

    Note:   LegendEntry is a technical internal attribute. You will most likely want to use the library interface attribute Legend in order to set legend entries.

If legends are active (i.e., LegendVisible is set to TRUE), LegendEntry controls which objects have entries in the legend. Only objects with LegendEntry = TRUE show up there.

As long as LegendVisible has its default value of FALSE, LegendEntry has no effect whatsoever.

Examples

Example 1

By default, functions have LegendEntry = TRUE, while, e.g., lines do not:

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

Use LegendEntry to turn on the legend entry for the line:

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

See Also

MuPAD Functions

More About

Was this topic helpful?