I have a contour plot and I would like to have finer control over the tooltips that are displayed.
For the sake of argument, suppose that I have the following plot,
ContourPlot[
Exp[-x^2 - y^2]
, {x, 0, 2}, {y, 0, 2}
, PlotRange -> Full
, Contours -> 10^Range[-4, 0, 0.1]
]
and I would like to force scientific notation on the tooltips - say, I'd like every tooltip in the form $10^{-3.7}$. More generally, I would like to apply a user-supplied function tooltipFunction
to the value F[x,y]
of the plotted function at the contour and display this as the tooltip.
The documentation for ContourLabels
hints that this should be possible, via a specification of the form
ContourLabels->{f,g}
usesf[x,y,z]
as an explicit displayed label, and usesg[x,y,z]
as a tooltip for each complete contour line.
However, there are no examples on the documentation and naive implementations of this don't seem to work.
Is there any way to implement this, preferably within the confines of the ContourPlot call?
Comments
Post a Comment