Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #7988
| From | sibir <martin.rommel@gmail.com> |
|---|---|
| Newsgroups | comp.soft-sys.math.mathematica |
| Subject | missing Tooltip for ArrayPlot etc. - workaround |
| Date | 2012-01-19 10:12 +0000 |
| Organization | Steven M. Christensen and Associates, Inc and MathTensor, Inc. |
| Message-ID | <jf8qa2$3k1$1@smc.vnet.net> (permalink) |
People on the group have occasionally bemoaned the lack of support for
Tooltip with ArrayPlot and the like.
I was missing this handy functionality as well today and came up with
a workaround.
If somebody has a better solution or suggestions for improvement,
please post!
Of course, built-in support like for ListPlot would be the best.
Note, that my example below suffers from a lack of range checking for
the array indices. I minimize it by not having any PlotRangePadding,
but you can still get an error if you move the mouse pointer slowly
over the top or right edge. (I'm using 8.0.4.0 on Windows, 64 bit)
With[{a = Table[i + Sin[i^2 + j^2], {i, 0, 4, .1}, {j, 0, 4, .1}]},
Dynamic@Tooltip[
ArrayPlot[a, ColorFunction -> "SunsetColors", PlotRangePadding ->
None],
a[[Sequence @@With[{pt =IntegerPart /@ MousePosition["Graphics",
{0, 0}]}, {Length[a] - pt[[2]], 1 + pt[[1]]}]]]
]
]
Back to comp.soft-sys.math.mathematica | Previous | Next | Find similar | Unroll thread
missing Tooltip for ArrayPlot etc. - workaround sibir <martin.rommel@gmail.com> - 2012-01-19 10:12 +0000
csiph-web