MathGroup Archive 2007

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: RE: Re: Re: 6.0 Get Graphics Coordinates...

  • To: mathgroup at smc.vnet.net
  • Subject: [mg78017] Re: [mg77971] RE: [mg77817] Re: [mg77755] Re: 6.0 Get Graphics Coordinates...
  • From: Curtis Osterhoudt <cfo at lanl.gov>
  • Date: Thu, 21 Jun 2007 05:49:43 -0400 (EDT)
  • Organization: LANL
  • References: <f4on38$7sg$1@smc.vnet.net> <200706171011.GAA01990@smc.vnet.net> <200706201019.GAA12842@smc.vnet.net>
  • Reply-to: cfo at lanl.gov

Hi, Ingolf, 

   It looks really promising. It doesn't work for me (the Alt-clicking on the 
graphics cells), I assume because KDE has some 
Alt-click-drag-window-to-new-position functionality which is stealing control 
from your clever palette. I'll try to test on some other windowing systems, 
with and without their functions enabled.

               Thanks, 
                       C.O.



On Wednesday 20 June 2007 04:19:41 Ingolf Dahl wrote:
> Here is my suggestion:
> I have created a Matematica-6 palette with three buttons, intended to mimic
> the GetGraphicsCoordinates from Mathematica 5.
>
> Use:
> 1. Select a graphics cell and press the "Add LocatorPane" button.
> 2. Press "Alt" and click the mouse to add or delete point ("locators") to
> the graphics.
> 3. Press the "Copy locator position" to copy a list of the locator
> coordinates to the Clipboard.
> 4. Select a graphics cell and phe "Remove LocatorPane" to reset the
> graphics to initial conditions (if you want to do that)
>
> You get the flexibility that it is possible to adjust the position of the
> locators. It seems necessary to start with one point present. I have chosen
> to put this point at {0,0}.
>
> Best regards
>
> Ingolf Dahl
>
> Code follows:
>
> CreatePalette[
>   Column[{Button["Add LocatorPane",
>      SelectionMove[InputNotebook[], All, CellContents];
>      NotebookWrite[
>       InputNotebook[], (DynamicModuleBox[{$CellContext`pts$$ = {{0.,
>               0.}}}, LocatorPaneBox[Dynamic[$CellContext`pts$$], #,
>            LocatorAutoCreate -> True], DynamicModuleValues :> {}]) &@
>        NotebookRead[InputNotebook[]]]],
>     "Use Alt+Click to add or delete locators!",
>     Button["Copy locator positions",
>      FrontEndExecute[FrontEndToken["Copy"]];
>      SelectionMove[InputNotebook[], All, CellContents];
>      Module[{b}, b = NotebookRead[InputNotebook[]];
>       If[And[Length[b] >= 3, MatchQ[b[[2]], _LocatorPaneBox]],
>        b = b[[1, 1]];
>        SelectionMove[ClipboardNotebook[], All, Notebook];
>        NotebookWrite[ClipboardNotebook[], ToBoxes[b], All];
>        SelectionMove[ClipboardNotebook[], All, Notebook]]]],
>     Button["Remove LocatorPane",
>      SelectionMove[InputNotebook[], All, CellContents];
>      Module[{b}, b = NotebookRead[InputNotebook[]];
>       If[And[Length[b] >= 3, MatchQ[b[[2]], _LocatorPaneBox]],
>        NotebookWrite[InputNotebook[], b[[2, 2]]]]]],
>     Dynamic[MousePosition["Graphics"]]}],
>   WindowTitle -> "Get Graphics Coordinates"];
>
> > -----Original Message-----
> > From: Murray Eisenberg [mailto:murray at math.umass.edu]
> > Sent: den 17 juni 2007 12:12
> > To: mathgroup at smc.vnet.net
> > Subject: [mg77817] Re: [mg77755] Re: 6.0 Get Graphics Coordinates...
> >
> > That use of Tooltip merely displays the coordinates of the
> > point.  It does not save it in a buffer from which one can
> > later paste it.
> >
> > David wrote:
> > > Murray Eisenberg wrote:
> > >> Useless??  Hardly!  Surely just doing Plot[...] and then
> > >> Ctrl-clicking is a lot easier for a beginner (e.g., a
> >
> > student using
> >
> > >> Mathematica) than to deal with a Dynamic object.
> > >>
> > >> On the other hand, and apart from the issue of what to do with
> > >> Ctrl-click when the graphics object is dynamically
> >
> > generated, there
> >
> > >> would seem to be a design issue: Now, in 6.0,
> >
> > Ctrl-mouse-button-down
> >
> > >> is the start of a zoom-in/zoom-out for a 3D graphic.
> > >>
> > >> Jens-Peer Kuska wrote:
> > >>> Hi,
> > >>>
> > >>> it has been droped because it is useless try
> > >>>
> > >>> gr = Plot[Sin[x^2], {x, 0, 2 Pi}];
> > >>>
> > >>> and
> > >>>
> > >>> DynamicModule[{pnt = {0, 0}},
> > >>>   gr /. Graphics[gg_, opts___] :>
> > >>>     Graphics[Append[gg, Tooltip[Locator[Dynamic@ pnt],
> >
> > Dynamic@ pnt]],
> >
> > >>>      Prepend[Prepend[{opts}, PlotLabel -> Dynamic[pnt]],
> > >>>       AxesLabel -> {Dynamic[First[pnt]], Dynamic[Last[pnt]]}]]
> > >>>   ]
> > >>>
> > >>> and
> > >>>
> > >>> DynamicModule[{pts = {{0, 1/2}, {2, 1/2}}},
> >
> > LocatorPane[Dynamic[pts],
> >
> > >>>    gr, LocatorAutoCreate -> True]]
> > >>>
> > >>> Alt-Mouse click will add points ..
> > >>>
> > >>> Regards
> > >>>    Jens
> > >>>
> > >>> roby.nowak at gmail.com wrote:
> > >>>> hello, what happened to:
> > >>>> 5.2  Get Graphics Coordinates...
> > >>>>
> > >>>> in version 5.2 you could click inside a graphic and when holding
> > >>>> down the <Ctrl> key the coordinates of the cursor within the
> > >>>> graphics would be displayed. you could then click with the mouse
> > >>>> and every clicked position got saved in a buffer. then you could
> > >>>> copy and paste the saved coordinates as a list of number pairs.
> > >>>>
> > >>>> regards robert
> > >
> > > How about the following simple alternative? It closely approximates
> > > the display of points available in pre-6.0, but only shows actual
> > > points on the curve (a benefit for me).
> > >
> > > Plot[Tooltip[Sin[x], Dynamic[MousePosition["Graphics"]]],
> >
> > {x, 0, 10}]
> >
> >
> >
> > --
> > Murray Eisenberg                     murray at math.umass.edu
> > Mathematics & Statistics Dept.
> > Lederle Graduate Research Tower      phone 413 549-1020 (H)
> > University of Massachusetts                413 545-2859 (W)
> > 710 North Pleasant Street            fax   413 545-1801
> > Amherst, MA 01003-9305



-- 
==========================================================
Curtis Osterhoudt
cfo at remove_this.lanl.and_this.gov
PGP Key ID: 0x4DCA2A10
Please avoid sending me Word or PowerPoint attachments
See http://www.gnu.org/philosophy/no-word-attachments.html
==========================================================


  • Prev by Date: Re: Integrate modified in version 6?
  • Next by Date: Re: ComplexExpand in Mathematica 5.2 and 6
  • Previous by thread: RE: Re: Re: 6.0 Get Graphics Coordinates...
  • Next by thread: RE: : 6.0 Get Graphics Coordinates...