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:
-
Automatic automatically highlight plot elements None do not highlight plot elements effect use 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:
-
Appearance Automatic overall style of the callout Background Automatic style of the label background CalloutMarker None marker to use for the anchor position apos CalloutStyle Automatic style to use for strokes and knockouts Frame Automatic frame of the label box FrameMargins Automatic margins to leave inside the frame LabelStyle {} style to use for the label LeaderSize Automatic length and angle to use for the leader RoundingRadius 0 radius 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:
-
Background Automatic the background color to use BaselinePosition Baseline alignment relative to surrounding text BaseStyle {} base style specifications ContentPadding True whether to shrink the margins tightly around the contents Frame False whether to include a frame FrameMargins Automatic margins to leave inside the frame FrameStyle Automatic graphics directives giving a style for the frame ImageMargins 0 margins around the image of the displayed frame ImageSize Automatic the overall image size of the displayed frame RoundingRadius Automatic radius for rounded corners StripOnInput False whether 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 allBasic Examples (4)
Scope (20)
Textual Highlighting (2)
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::
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:
Options (12)
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)
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