PlotHighlighting
Details
- PlotHighlighting adds highlighting to 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 are useful for explaining features to others.
- Possible highlighting effects for PlotHighlighting include:
-
Automatic automatically highlight plot elements All highlight plot elements None do not highlight plot elements style use color, thickness, etc. to style 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 - PlotHighlightingAutomatic highlights plot elements unless there are already elements like tooltips, labels, callouts or other interactive behaviors that would interfere.
- PlotHighlightingAll highlights plot elements even in the presence of other elements.
- Possible highlighting effects effect can be:
-
"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:
-
style highlight the indicated curve "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 cross hairs 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.
Examples
open allclose allBasic Examples (5)
Mouse over a curve to show coordinates and a marker point with the default Automatic highlighting:
Mouse over a curve to have it highlight with the given style:
Mouse over a curve to show the coordinates and droplines to the axes:
Use Placed to add static highlights to the curves at the position :
Use PlotHighlightingNone to disable all highlighting effects:
Scope (19)
Named Effects (6)
Use the "Ball" effect to show a point labeled with the coordinates:
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 and :
Use the "YSlice" effect to show a horizontal line and labels:
The default highlighting effects are also disabled when other labels are present:
PlotHighlightingAll will include the default highlighting, but may interfere with other elements:
Highlighted[…,None] can be used to remove highlighting from specific elements:
Component Effects (13)
"IndicatedPoint" shows a point when the mouse position is close to a plot element:
Use a red point for the highlight:
"NearestPoint" always selects a point, regardless of distance:
Use a red point for the highlight:
"XNearestPoint" shows all the points that share the same value as the mouse position:
Use a red point for the highlight:
"YNearestPoint" shows all the points that share the same value as the mouse position:
Use a red point for the highlight:
"Crosshairs" draws vertical and horizontal infinite lines at the mouse position:
"XYDropline" draws droplines to the axes:
"XLine" and "YLine" draw vertical and horizontal lines across the plot:
"XDropline" and "YDropline" draw vertical and horizontal lines across the plot:
"XYLabel" labels the plot elements with the coordinates:
"XYAxisLabel" labels the axes with the coordinates of the mouse position:
"XLabel" shows the coordinate corresponding to the mouse position or indicated value:
"YLabel" shows the coordinate corresponding to the mouse position or indicated value:
Label effects take Callout options as styling parameters:
Create a custom effect by combining different components:
Text
Wolfram Research (2023), PlotHighlighting, Wolfram Language function, https://reference.wolfram.com/language/ref/PlotHighlighting.html.
CMS
Wolfram Language. 2023. "PlotHighlighting." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/PlotHighlighting.html.
APA
Wolfram Language. (2023). PlotHighlighting. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/PlotHighlighting.html