

north: This is used to plot the legend in top of the axes or chart and is placed inside of the chart.There are various values that can be assigned to the property like: Location is one of the main property of the legend which decides the location of the legend.

There are various properties of the legend in Matlab which are discussed below. Here sin(3a) is the value and it is added as legend label to the plot. This can be done by using the legend property ‘DisplayName’ and the label of the legend as its value. In the above example, another line is added to an existing plot using the legend label in the plot command as shown in the highlighted part. In this example, we have added another line to the existing line as mentioned in the above example. To plot another line and specify the labels of the legend using DisplayName property of the legend in the plot command. In the above example, the legend for the two lines is shown in the top right corner of the plot, one line depicting the values for the function sin(a) and the other line depicting the values for the function sin(2a). To plot two lines and display the legend in the present chart. Please find the below examples that explain the use of legends in Matlab: Example #1 L=legend(off): This is used to delete the legend and its customization from the plot.L=legend(visibility): This is used to set the visibility of the legend which has different values like the show, hide and toggle.L=legend(bkgd): This is used to set the background appearance and its outline.There are various properties of the legends which are discussed below. We can give the property name in ‘Name of the property’ argument and the required value after that. L=legend (_,’Name of the property’, ‘value of the property’): This is used when we want to customize the appearance of legends in the plot.The default value of the orientation is vertical. L=legend (_,’orientation of the legend’): This is used to specify the orientation of the legend that should be placed in the plot.This property of the legend should always be given after all the input arguments.

