Highlighted

Highlighted[expr]

displays a highlighted version of expr.

Highlighted[expr,effect]

uses the effect effect to highlight plot elements representing expr.

Details and Options

  • On its own, Highlighted[expr] highlights the expression by drawing it with a yellow background.
  • Highlighted[expr,effect] adds highlighting to specific plot elements to aid the understanding of plots.
  • Interactive highlighting that depends on the cursor positions is useful for exploring features in a plot, while static highlighting features at specific locations is useful for explaining features to others.
  • Possible highlighting effects for plots include:
  • Automaticautomatically highlight plot elements
    Nonedo not highlight plot elements
    effectuse a given effect to highlight plot elements
    Placed[effect,pos]statically highlight the plot at a given position
    {effect1,..}use multiple forms of highlighting
  • Possible highlighting effects effect include:
  • "name"use a named highlighting effect
    {comp1,comp2,}combine components compi into a single effect
    {comp,<|param1val1|>}use component comp with parametrized settings
  • Position specifications pos vary by function. Common forms of positions include:
  • x, {x}effect at {x,y} with y chosen automatically
    {x,y}effect at {x,y}
    {pos1,pos2,}multiple positions posi
  • Common highlighting effects include:
  • "Ball"highlight the indicated point in a curve
    "Dropline"highlight the indicated point in a curve with droplines to the axes
    "XSlice"highlight all points along a vertical slice
    "YSlice"highlight all points along a horizontal slice
  • The highlighting specification {comp1,comp2,} uses the individual component effects compi to construct an overall effect.
  • The compi can be a named string "comp" or a named string combined with an association of parameters {"comp",<|"param1"value1,|>}.
  • Point-based effect components comp include:
  • "IndicatedPoint"label the cursor position
    "NearestPoint"draw a ball at the point closest to the cursor
    "XNearestPoint"draw a ball at the point or points closest to the cursor in the x direction
    "YNearestPoint"draw a ball at the point or points closest to the cursor in the y direction
  • The above component effects all take the param "Style".
  • Components comp that draw reference lines include:
  • "Crosshairs"free-form crosshairs following the cursor
    "XYDroplines"droplines from the cursor to the axes or frames
    "XLine"vertical line spanning the graphic
    "YLine"horizontal line spanning the graphic
    "XDropline"vertical droplines from the cursor to the axes or frames
    "YDropline"horizontal droplines from the cursor to the axes or frames
  • The above component effects all take the param "Style".
  • Label-based effect components include:
  • "XYLabel"label the cursor position
    "XLabel"label the x coordinate of the cursor position
    "YLabel"label the y coordinate of the cursor position
    "XYAxisLabels"label the coordinates along the axes or frame
    "XAxisLabel"label the x coordinate along the axis or frame
    "YAxisLabel"label the y coordinate along the axis or frame
  • The label component effects all take the same parameters as Callout:
  • AppearanceAutomaticoverall style of the callout
    Background Automaticstyle of the label background
    CalloutMarkerNonemarker to use for the anchor position apos
    CalloutStyleAutomaticstyle to use for strokes and knockouts
    Frame Automaticframe of the label box
    FrameMargins Automaticmargins to leave inside the frame
    LabelStyle{}style to use for the label
    LeaderSizeAutomaticlength and angle to use for the leader
    RoundingRadius 0radius for rounded corners
  • Applicable highlighting effects vary by function and environment and are documented for each function.
  • The following options can be given to control the behavior of textual highlights:
  • BackgroundAutomaticthe background color to use
    BaselinePositionBaselinealignment relative to surrounding text
    BaseStyle{}base style specifications
    ContentPaddingTruewhether to shrink the margins tightly around the contents
    FrameFalsewhether to include a frame
    FrameMarginsAutomaticmargins to leave inside the frame
    FrameStyleAutomaticgraphics directives giving a style for the frame
    ImageMargins0margins around the image of the displayed frame
    ImageSizeAutomaticthe overall image size of the displayed frame
    RoundingRadiusAutomaticradius for rounded corners
    StripOnInputFalsewhether to strip the Highlighted wrapper when the tyepset form is used as input
  • By default, the typeset form of Highlighted[expr] evaluates to itself, including the Highlighted head. With the option StripOnInputTrue, the typeset form evaluates to expr without the Highlighted head. »

Examples

open allclose all

Basic Examples  (4)

Highlight any expression:

Use interactive highlighting on a single curve in a plot:

Highlight a point on a curve with a label and droplines to the axes:

Disable highlighting on one curve:

Scope  (20)

Textual Highlighting  (2)

Highlight any object:

By default, the typeset form of Highlighted[expr] evaluates to itself:

This can be changed using the option StripOnInput:

Highlight Effects  (5)

Highlighted[,None] can be used to remove automatic highlighting from specific elements:

Highlight the first curve with a labeled ball that follows the cursor:

Highlight a fixed location with the labeled ball:

Use the "Dropline" effect to show a point labeled with the coordinates and droplines to the axes:

Place a fixed highlight at and :

Use the "XSlice" effect to show a vertical line and labels::

Place a fixed highlight at :

Use the "YSlice" effect to show a horizontal line and labels:

Component Effects  (13)

"IndicatedPoint" shows a point when the position is close to a plot element:

No point is shown if the position is too far from the plot element:

Automatically find a point based on the value:

"NearestPoint" shows the nearest point to the position in the plot element:

The point is shown even if the position is far away from the plot element:

Automatically find a point based on the value:

"XNearestPoint" shows all the points that share the same value as the position:

"YNearestPoint" shows all the points that share the same value as the position:

Use the "Style" property to change the appearance of the points:

"Crosshairs" draws vertical and horizontal lines at the position:

"XYDropline" draws droplines from the position to the axes:

Find the position on the curve closest to :

"XLine" and "YLine" draw vertical and horizontal lines across the plot:

"XDropline" and "YDropline" draw vertical and horizontal droplines to the axes:

If there are multiple points, multiple droplines will be drawn:

Use the "Style" property to change the appearance of the lines:

"XYLabel" labels the plot elements with the coordinates:

If there are multiple points, each is labeled:

"XLabel" shows the coordinate corresponding to the value of the position:

"YLabel" shows the coordinate corresponding to the value of the position:

Label effects take Callout options as styling parameters:

Create a custom effect by combining different components:

Style the different elements in the effect:

Options  (12)

Background  (1)

Specify a highlight color:

BaselinePosition  (1)

Bottom align a series of highlighted expressions:

BaseStyle  (1)

Set the base style for the contents to a different font size and color:

ContentPadding  (1)

Remove extra whitespace around a label with no ascenders or descenders:

Frame  (1)

Add a frame around the highlighted expression:

FrameMargins  (1)

Add margins within the highlighted frame:

FrameStyle  (1)

Change the frame style:

ImageMargins  (1)

Add margins outside the highlighted region:

ImageSize  (1)

Set the highlighted frame to a fixed image size:

RoundingRadius  (1)

Change the rounding radius for the corners:

StripOnInput  (2)

Create a highlighted output that evaluates to the first argument of Highlighted:

When the output is used as input, the Highlighted wrapper disappears:

When the hold is released, evaluation proceeds normally:

An explicit setting StripOnInput False will be removed when the output is used as input:

Applications  (1)

Create an integral in which the integrand is highlighted:

The output can be used as input to evaluate the integral:

Properties & Relations  (3)

Used Framed to just add a frame:

Panel provides a kind of highlight design to fit into native operating system controls:

Squiggled provides an alternative highlighting idiom:

Wolfram Research (2016), Highlighted, Wolfram Language function, https://reference.wolfram.com/language/ref/Highlighted.html (updated 2023).

Text

Wolfram Research (2016), Highlighted, Wolfram Language function, https://reference.wolfram.com/language/ref/Highlighted.html (updated 2023).

CMS

Wolfram Language. 2016. "Highlighted." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2023. https://reference.wolfram.com/language/ref/Highlighted.html.

APA

Wolfram Language. (2016). Highlighted. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/Highlighted.html

BibTeX

@misc{reference.wolfram_2023_highlighted, author="Wolfram Research", title="{Highlighted}", year="2023", howpublished="\url{https://reference.wolfram.com/language/ref/Highlighted.html}", note=[Accessed: 19-March-2024 ]}

BibLaTeX

@online{reference.wolfram_2023_highlighted, organization={Wolfram Research}, title={Highlighted}, year={2023}, url={https://reference.wolfram.com/language/ref/Highlighted.html}, note=[Accessed: 19-March-2024 ]}