When plotting anatomy data with

AnatomyPlot3D[Entity["AnatomicalStructure", "LeftIndexFinger"], Method -> {"Tooltips" -> True}]

the respective tooltips are shown at the mouse pointer location

enter image description here

Is there a way to copy the content of the selected tooltip to the clipboard and paste it to another cell? I have seen other answered questions (like this), but there tooltips were generated for each item/entity separately. When plotting an AnatomyPlot3D with the tooltip method all tooltips are already included.


1 Answer 1


You can do post processing on the anatomy plot with something like

    AnatomyPlot3D[Entity["AnatomicalStructure", "LeftIndexFinger"],
        Method -> {"Tooltips" -> True}
    Tooltip[a_, b_] :> EventHandler[Tooltip[a, b],
        {"MouseClicked" :> CopyToClipboard[ToString[b, InputForm]]},
        PassEventsDown -> True

Clicking and dragging will move the 3D object without copying anything. Clicking an object with a tooltip and not dragging will copy the tooltip to the clipboard.

  • $\begingroup$ I tried that but it put a TextCell in my clipboard rather than a string. $\endgroup$
    – Jason B.
    Jun 21 at 16:29
  • $\begingroup$ How exactly do you get a string? Do you paste in between cells, creating a new cell, or within an already existing cell? I get different results from those two, and only one of them is usable: i.stack.imgur.com/7rXyc.png $\endgroup$
    – Jason B.
    Jun 21 at 17:18
  • $\begingroup$ I pasted between cells. It created an input cell with a string like Cell["\"foo\"", "Input"] and not a proper input cell with BoxData like Cell[BoxData["\"\<foo\>\""], "Input"]. If I paste in an existing cell, I get an inline cell. So I guess ToString is better. $\endgroup$
    – Michael E2
    Jun 21 at 18:18
  • $\begingroup$ Hi Jason, this works great! Combined with a snippet from mathematica.stackexchange.com/questions/16925/… I can display the selected structures right below the plot: clicks = {}; Column[{ReplaceAll[ AnatomyPlot3D[Entity["AnatomicalStructure", "LeftIndexFinger"], Method -> {"Tooltips" -> True}], Tooltip[a_, b_] :> EventHandler[ Tooltip[a, b], {"MouseClicked" :> AppendTo[clicks, ToString[b, InputForm]]}, PassEventsDown -> True]], Dynamic[clicks // TableForm]}] $\endgroup$
    – Kardashev3
    Jun 22 at 9:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.