Wolfram Language

Visualization: Labels, Scales, Exclusions

Controlling Callout Labels

Specify font styles for callout text.

In[1]:=
Click for copyable input
Plot[{Callout[Sin[x] + 1, "label", Above, LabelStyle -> Directive[Italic, Small, ColorData[106, 1]]], Callout[Sin[x] + 2, "label", Above, LabelStyle -> Directive[Bold, Medium, ColorData[106, 2]]], Callout[Sin[x] + 3, "label", Above, LabelStyle -> Directive[Underlined, Large, ColorData[106, 3]]]}, {x, 0, 2 Pi}, ImageSize -> 400, PlotTheme -> "Business"]
Out[1]=

Assign a label frame and specify margin sizes.

In[2]:=
Click for copyable input
Plot[{Callout[Sin[x + Pi/3], "no frame", Above], Callout[Sin[x], "frame", Above, Frame -> True], Callout[Sin[x - Pi/2], "Margins: 10", Above, Frame -> True, FrameMargins -> 10], Callout[Sin[x - 6 Pi/5], "Margins: {5, 15}", Above, Frame -> True, FrameMargins -> {5, 15}]}, {x, 0, 2 Pi}, ImageSize -> 400, PlotRange -> {-1, 2}, PlotTheme -> "Business"]
Out[2]=

Specify the radius of frame corners.

In[3]:=
Click for copyable input
Plot[{Callout[Sin[x + Pi/4], "Radius: 0", Above, Frame -> True, FrameMargins -> 10, RoundingRadius -> 0], Callout[Sin[x - Pi/4], "Radius: 5", Above, Frame -> True, FrameMargins -> 10, RoundingRadius -> 5], Callout[Sin[x - 3 Pi/4], "Radius: 10", Above, Frame -> True, FrameMargins -> 10, RoundingRadius -> 10], Callout[Sin[x - 5 Pi/4], "Radius: 20", Above, Frame -> True, FrameMargins -> 10, RoundingRadius -> 20]}, {x, 0, 2 Pi}, ImageSize -> 400, PlotRange -> {-1, 2}, PlotTheme -> "Web"]
Out[3]=

Specify a color for the background and text.

In[4]:=
Click for copyable input
Plot[{Callout[Sin[x], Sin[x], Above, Background -> RGBColor[0.790588, 0.201176, 0], LabelStyle -> Directive[10, White]], Callout[Cos[x], Cos[x], Below, Background -> RGBColor[0.192157, 0.388235, 0.807843], LabelStyle -> Directive[10, White]]}, {x, 0, 2 Pi}, PlotTheme -> "Web"]
Out[4]=

Specify a color for both the frame and leader.

In[5]:=
Click for copyable input
ListPlot[{Callout[Table[Sin[x], {x, 0, 2 Pi, Pi/16}], Sin[x], Above, Frame -> True, CalloutStyle -> RGBColor[0.34398, 0.49112, 0.89936]], Callout[Table[.4 + Cos[x], {x, 0, 2 Pi, Pi/16}], Cos[x], Below, Frame -> True, CalloutStyle -> RGBColor[0.97, 0.606, 0.081]]}, ImageSize -> 400, PlotTheme -> "Business"]
Out[5]=

Specify an opacity for the background.

In[6]:=
Click for copyable input
ListPlot[Table[ Callout[n, ToString[n], Right, FrameMargins -> {15, 10}, Background -> Directive[RGBColor[0.34398, 0.49112, 0.89936], Opacity[n]], LabelStyle -> Directive[Bold, White]], {n, .2, 1, .2}], ImageSize -> Medium, PlotRange -> {{.5, 6.5}, {0, 1.2}}, PlotTheme -> "Business"]
Out[6]=

Callout backgrounds are semitransparent by default to reveal the underlying graphics.

In[7]:=
Click for copyable input
Plot[{Cos[x], Cos[x + 0.5], Cos[x + 1], Cos[x + 1.5], Callout[Cos[x + 2], "transparency", 1.75, 2.5, FrameMargins -> {10, 10}, LabelStyle -> Large]}, {x, 0, Pi}, ImageSize -> 400, PlotTheme -> "Marketing"]
Out[7]=

Related Examples

de es fr ja ko pt-br ru zh