LegendLayout

LegendLayout
is an option for legends that specifies how to format the legend content.

DetailsDetails

  • Possible settings for LegendLayout are:
  • Automaticautomatic layout
    "Row"left-to-right layout
    "Column"bottom-to-top layout
    "ReversedRow"right-to-left layout
    "ReversedColumn"top-to-bottom layout
    flayout determined by function f
  • For LineLegend, PointLegend, and SwatchLegend, the argument to the function f is a table of styles and associated labels.
  • For BarLegend, the argument to f is a color function cf, range of values , and list of contour values contours.

ExamplesExamplesopen allclose all

Basic Examples (3)Basic Examples (3)

Format a legend horizontally:

In[1]:=
Click for copyable input
Out[1]=
In[2]:=
Click for copyable input
Out[2]=

Format a legend vertically:

In[1]:=
Click for copyable input
Out[1]=

Reverse the order:

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

Write a function to construct a legend as a formatted table:

In[1]:=
Click for copyable input
In[2]:=
Click for copyable input
Out[2]=
New in 9
New to Mathematica? Find your learning path »
Have a question? Ask support »