Callout

Callout[data,expr]

displays expr in a plot as a callout pointing to data.

Callout[data,expr,pos]

displays a callout with expr at a position specified by pos.

Callout[data,expr,pos,apos]

displays a callout anchored at a position specified by apos.

Details and Options

  • Callout[data,expr,] can be used as a wrapper in visualization functions such as Plot, ListPlot, etc.
  • Callout[expr,] can be used in PlotLabels to specify callouts, similar to Placed.
  • expr can be any expression, including strings, graphics, and formulas.
  • The callout position pos and anchor positions apos are automatically computed when specific positions are not given.
  • Possible callout positions pos vary by function, but typically include:
  • xnear the data at a position x
    {x,y}at a position {x,y}
    Scaled[s]scaled position s along the data
    Above,Below,Before,Afterrelative positions
    {s,Above},{s,Below},relative position at position s along the data
    {pos,epos}epos in expr placed at position pos
    Automaticpos is automatically determined
  • Possible anchor positions apos include:
  • xnear the data at a position x
    {x,y}at a position {x,y}
    Scaled[s]scaled position s along the data
    Automaticapos is automatically determined
  • Callout takes the following options:
  • AppearanceAutomaticoverall style of the callout
    BackgroundAutomaticstyle of the label background
    CalloutMarkerNonemarker to use for the anchor position apos
    CalloutStyleAutomaticstyle to use for strokes and knockouts
    FrameAutomaticframe of the label box
    FrameMarginsAutomaticmargins to leave inside the frame
    LabelStyle{}style to use for the label
    LabelVisibilityAutomaticpriority relative to other labels
    LeaderSizeAutomaticlength and angle to use for the leader
    RoundingRadius0radius for rounded corners
  • Possible values for Appearance:
  • "Leader"a leader is used from label to data
    "CurvedLeader"a curved leader
    "SlantedLabel"an angled label and neck
    "Frame"full frame around expr
    "Line"a partial frame around expr
    "Corners"frame corners around expr
    "Balloon"a balloon around expr
    "LineBalloon"a partial balloon around expr
    Noneno leader is drawn
  • Possible settings for CalloutMarker are:
  • Noneno marker is used
    "name"use named marker
    Arrowheads[]arrowhead specification
    gexpression g
  • The named markers "name" are:
  • "CirclePoint","Circle"circular markers
    "BoxPoint", "Box"square markers
    "Star", "OpenStar"star markers
    "Arrow", "OpenArrow"arrow markers
  • CalloutStyle specifies the style to be used for the marker, leader, neck, and frame. The marker, leader, and neck typically have the space around them padded with the ambient background color to increase visibility.
  • Possible values for CalloutStyle are:
  • Automaticdefault style is used
    styuse style sty, with the default knockout style
    {sty,kosty}use kosty for the knockout style
  • Possible values for LeaderSize:
  • Automaticautomatic leader size
    lrlength of the leader
    {lr,lθ,s}leader length lr at angle lθ and the gap s to the anchor
    {{lr,lθ,s},{nr,nθ}}leader specification with neck length nr at angle nθ

Examples

open allclose all

Basic Examples  (4)

Label points with callouts:

Use a named position for the callout:

Label a curve with a callout:

Use a named position relative to the curve for the callout:

Stylize the callout:

Scope  (15)

Label Placement  (8)

Callouts are placed near individual points:

Callouts are automatically placed at the ends of curves:

Place callouts relative to the points:

Place labels near an absolute position on a curve:

Place labels near a scaled position on a curve:

Place labels above the curve near the given positions:

Place a label at a specific point:

Specify the position in the label that connects to the leader:

Anchor Placement  (3)

Specify where the leader should point to on the curve with an absolute position:

Specify where the leader should point to on the curve with a scaled position:

Specify an exact point the leader should point to:

Presentation  (4)

Place the callout in a frame:

Use a balloon:

Circle the anchor point for the callout on the curve:

Point to it with an arrow:

Use uniform leader lines for the callouts:

Style the callouts to match their curves:

Options  (17)

Appearance  (2)

Use different named appearances:

Combine appearance with other styling:

Background  (1)

Stylize the background of the callout label:

CalloutMarker  (2)

Use named markers:

Use Arrowheads as a marker:

CalloutStyle  (2)

Change the color of the leader:

Specify the knockout style:

Frame  (1)

Use frame:

Draw only the top and bottom frame edges:

FrameMargins  (1)

Control the margins around the callout label:

With the balloon appearance:

LabelVisibility  (3)

Callouts are pruned to avoid collisions:

Label all the even-numbered points in a plot, even if some of them collide:

Label even-numbered points while avoiding collisions:

LeaderSize  (3)

Specify the leader length:

Control the slope of the leader:

Specify the distance between the leader and the curve:

Specify both leader and neck length and angle:

LabelStyle  (1)

Style the callout label:

RoundingRadius  (1)

Use a rounded rectangle around the callout label:

With the balloon appearance:

Applications  (1)

Get the area and population for every country in the world:

Add callouts to some of the countries that have relatively extreme areas or populations:

Plot the data on a log-log scale:

Introduced in 2016
 (11.0)
 |
Updated in 2019
 (12.0)