PlotLegend

As of Version 9, all the functionality of the PlotLegends package is built into the Wolfram System. >>

PlotLegend
is an option for Plot, ListPlot, and related functions that assigns text to lines in a 2D plot to create a legend for that plot.

DetailsDetails

  • To use PlotLegend, you first need to load the Plot Legends Package using Needs["PlotLegends`"].
  • PlotLegend->{text1,text2,} assigns text to each line in the same fashion as PlotStyle.
  • PlotLegend also enables Plot and related functions to accept options for Legend, which will modify the legend produced.

ExamplesExamplesopen allclose all

Basic Examples  (1)Basic Examples  (1)

In[1]:=
Click for copyable input

Add a legend to a plot to identify curves:

In[2]:=
Click for copyable input
Out[2]=
In[3]:=
Click for copyable input
Out[3]=
Translate this page: