Re: Mathematica 6 Graphics Options
- To: mathgroup at smc.vnet.net
- Subject: [mg82883] Re: Mathematica 6 Graphics Options
- From: "Joseph T. DeWitte, Jr." <nnesita at xemaps.com>
- Date: Fri, 2 Nov 2007 03:30:08 -0500 (EST)
- References: <f1s1t6$fi3$1@smc.vnet.net>
Daniel,
Here's a function I wrote that seems to solve the problem.
clickCoordinateList[g_Graphics]:=
DynamicModule[{pts={}},
Column[{
ClickPane[
Dynamic@Show[g,Graphics[{Black,Point/@pts}]],
(pts=Append[pts,#])&
],
StyleForm[
"\nStart clicking on the graph above. The list below will grow, \
with one new x-y coordinate pair for each click. When you're done, \
highlight the list from just before the first brace to just past the \
last one. Next, use Edit/Copy on the front end menu bar to put the \
list on the clipboard. Then you can Edit/Paste the list into a new \
input cell for further manipulation. If you highlight much beyond \
the list, you'll just get a string with the name of the internal \
coordinate list variable (pts$$) when you paste into a new cell, \
rather than the coordinates themselves. \n\n You may find it \
useful to copy this function into the init.m file in the \
$UserBaseDirectory/Kernel subdirectory so it's available every \
time you start Mathematica.\n",
FontFamily->"Helvetica",FontSize->12,
FontWeight->Bold,FontColor->Red
],
Dynamic[pts]
}]
]
Here's an example of how to use this function:
gMyGraph=Plot[Sin[x]/x,{x,-10,10},GridLines->Automatic,Frame->True]
clickCoordinateList[Show[gMyGraph,ImageSize->500]]
pastedPoints=**** paste list from above here ****;
deltas=Rest[pastedPoints]-Most[pastedPoints];
approximatePathLength=Plus@@(Sqrt[#.#]&/@deltas)
---Joe DeWitte
dh wrote:
> Hello All,
>
> In Mathematica 5 you could Option-Click into a 2D graphics and the coordinates
>
> of the cursor were displayed at lower left of the windows. By Ctrl-C you
>
> could even copy the coordinates to the clipboard. I am searching for
>
> quit some time in vain for an equivalent feature in Mathematica 6. Does anybody
>
> know if there is a replacement.
>
> Daniel Huber
>
>
>
- Follow-Ups:
- Re: Re: Mathematica 6 Graphics Options
- From: Murray Eisenberg <murray@math.umass.edu>
- Re: Re: Mathematica 6 Graphics Options