Group Abstract Group Abstract

Message Boards Message Boards

Tracing curve in a Graphic (Position Data?)

Posted 12 years ago
POSTED BY: Zach Wolfe
4 Replies

If not use tooltip, I propose to plot with Text.

data = Table[{x, Cos[x]}, {x, -Pi, Pi, Pi/8}]
Graphics[Text[#[[2]], #] & /@ data]

plot with text

POSTED BY: Yu(u)ki IWABUCHI

This functionality is not available by default in Mathematica, but it is easy to implement a practical version of it. With a little more work you could implement the same thing W|A has, but since that version is mainly better in presentation only, I won't bother with it.

First, you can use W|A directly form Mathematica. Try

== plot sin(x)

But I think this is not what you're looking for.

Try right clicking any graphics object, and choosing Get Coordinates in Mathematica. It'll show the coordinates of the point you hover. You can click several points to mark them, and copy their coordinates using Ctrl-C.

It is possible to customize this functionality using the CoordinatesToolOptions option.

f[x_] := Sin[x]

disp[{x_, y_}] := {x, f[x]}

Plot[f[x], {x, 0, 10}, 
 CoordinatesToolOptions -> {"DisplayFunction" -> disp, "CopiedValueFunction" -> disp}]

This version will display the function value in place of the $y$ coordinate.

POSTED BY: Szabolcs Horvát

I am not sure if this is answering you, But if you want to trace values on curve, ToolTip will work

data = Table[Tooltip[N@{x, Cos[x]}], {x, -Pi, Pi, .05}];
ListPlot[data, Joined -> True, Mesh -> Full]

Note: have to use Mesh->Full for the tooltip to show.

enter image description here

POSTED BY: Nasser M. Abbasi
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard