Re: 1. Input of screen coordinates; 2. Fast graphics

*To*: mathgroup at smc.vnet.net*Subject*: [mg26964] Re: 1. Input of screen coordinates; 2. Fast graphics*From*: "Allan Hayes" <hay at haystack.demon.co.uk>*Date*: Tue, 30 Jan 2001 03:38:16 -0500 (EST)*References*: <94vs7q$oa9@smc.vnet.net>*Sender*: owner-wri-mathgroup at wolfram.com

Manuel, I'm not quite sure of what you want, but you may find something of use in the following. Re question 1 cpd = ClipboardNotebook[]; Plot[Sin[x], {x, 0, 2Pi}]; - click on the cell holding the picture -with Control key held down click on some points on the curve - save (Control, S) - get the coordinates of the clicked points coords = NotebookGet[cpd][[1, 1, 1]]; Re question 2 Raster and RasterArray may help. -- Allan --------------------- Allan Hayes Mathematica Training and Consulting Leicester UK www.haystack.demon.co.uk hay at haystack.demon.co.uk Voice: +44 (0)116 271 4198 Fax: +44 (0)870 164 0565 "Manuel Arala Chaves" <machaves at fc.up.pt> wrote in message news:94vs7q$oa9 at smc.vnet.net... > > I have two questions: > > 1st question - Is there a way in Mathematica to input a couple of screen > coordinates with the mouse? > > The closest thing I know is: in a graphic, CTR+ALT+mouse shows the > coordinates in the graphic. Or (rather artificial), if you have a picture > inserted into the Mathematica notebook, you can move (with the mouse) > another graphics window over the picture and look at the successive screen > coordinates of the top left corner. > But in both cases you cannot "save" the coordinates you see into a > variable. Is this possible in another way? > > (What I need is the following: imagine you have a picture with a curve, > inserted in a Mathematica notebook; I would like to be able > to mark with the mouse enough points of the curve and then to use the > coordinates of those points to fit a curve in Mathematica - preferably in > parametric form - which would approximate the curve in the image). Any > suggestion? > > > 2nd question - Suppose you have an array 600x600 of numbers (of colors) in > Mathematica and you want to get an image of a square (600x600 pixels), > each pixel having a color depending on the number in the corresponding > position of the array. (If Color is the array and MaxColor the maximum > element of the array, the color of pixel {x,y} could be given by > Graphics[Hue[Color[[x,y]]/MaxColor]]). > Of course it is very easy to do that by appending instructions > Graphics[Hue[color[[x,y]]/MaxColor]], Graphics[Point[[x,y]]], ... and for > economy, if the color did not change, you may even suppress the color > instruction. This works for small arrays, but it takes a lot of computing > time if the array is big, e.g. 600x600. > Is there a fast way of getting the picture? > If not, I would consider saving the corresponding array to a > file and using another program to view the image. Any suggestion? > > Thanks in advance. > > Manuel Chaves > >