RE: RE: 1. Input of screen coordinates; 2. Fast graphics
- To: mathgroup at smc.vnet.net
- Subject: [mg27001] RE: [mg26958] RE: [mg26953] 1. Input of screen coordinates; 2. Fast graphics
- From: "JOHN C ERB" <JOHN_C_ERB at prodigy.net>
- Date: Tue, 30 Jan 2001 23:22:20 -0500 (EST)
- Sender: owner-wri-mathgroup at wolfram.com
I have used the method described by David Park, and it works. HOWEVER, when I try to select and paste a second set of data the first data set is still there. So when I paste the second time, I get both sets of data, even when I use the "paste & delete" option. Am I doing something wrong, or is this just the way it works? John C. Erb email: John_C_Erb at prodigy.net -----Original Message----- From: David Park [mailto:djmp at earthlink.net] To: mathgroup at smc.vnet.net Subject: [mg27001] [mg26958] RE: [mg26953] 1. Input of screen coordinates; 2. Fast graphics Manuel, You can click off points from a plot and copy them. 1) Click on the plot to select it. 2) Hold down Ctrl and then click of the series of points that you want to copy. 3) Then copy by any of the usual methods: right click and use the context menu, or use Copy in the Edit menu, or use Ctrl-C. 4) Paste into any Mathematica Input cell expression, again using the usual methods. For your second question, these are the timings I got for creating an array and then plotting it on a 800 Mhz PC. I designed the table so the Hue values would run from 0 to 1. It was necessary to include the decimal points in the iterators to avoid exact expressions and do machine precision calculations. Otherwise it takes much longer. (mat = Table[(1 + Cos[x]*Sin[y])/2, {x, 0., Pi, Pi/600.}, {y, 0., Pi, Pi/600.}];)//Timing {0.83 Second, Null} Timing[Show[Graphics[{Raster[mat, ColorFunction -> Hue]}], AspectRatio -> Automatic, Frame -> True]; ] {3.51 Second, Null} Is that too slow? David Park djmp at earthlink.net http://home.earthlink.net/~djmp/ > From: Manuel Arala Chaves [mailto:machaves at fc.up.pt] To: mathgroup 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 > > >