Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

get a table of coordinates from an image of a graph

101 views
Skip to first unread message

Peter Lindsay

unread,
Sep 15, 2010, 4:37:08 AM9/15/10
to
I don't know if this is even possible, but if it is then someone on this list will know:

I have a jpg image with a "wobbly" line cartesian graph [ X-Y axes etc ].

Is it possible by importing it, to get mathematica to "read" the graph and produce a table of coordinates ?

Obviously the table could be scaled subsequently to produce desired results to match the original graph.


Sorry if this is a daft question


Peter Lindsay

Sjoerd C. de Vries

unread,
Sep 16, 2010, 6:02:05 AM9/16/10
to
Hi Peter,

I sometimes use the "Get Coordinates" tool (select graph, then shift-
period to activate the tool) to do this manually. First, I get the
coordinates of the origin and a few points on the axes to determine
the scale, and then use the tool to select and copy/paste as much of
the coordinates of the graph as needed. Would be cool if this would be
automated, but I am not aware of any Mathematica tool that does this.

Cheers -- Sjoerd

magma

unread,
Sep 16, 2010, 6:02:16 AM9/16/10
to

> Sorry if this is a daft question
>
> Peter Lindsay

Actually Peter this is a very interesting question that somehow has
been floating in my subconscious for some time.

Generalizing: given a jpg picture of some (relatively simple) line
drawing, how can we convert it into a Mathematica expression?

I have thought about it for the past few minutes and did some simple
experiments.
My conclusion is that not only it can be done, but also that it is
relatively simple, if one is satisfied with a "Flinstones
approach" (meaning: semi-manual).

The general idea is to import the picture and use it as a background.
Then you will draw on it using some tools (for example the ctrl-L
tools), aiding Mathematica in recognizing the key features of the picture. At
the end the imported picture is discarded and you are left with your
Mathematica drawing.
When I say "draw on it using some tools", this might mean building a
specialized small package which can (for example) draw a GraphPlot
with user-input vertex coordinates. the user inputs the coords via
mouse clicks on appropriate locations of the drawing.
On the other end, just using the Ctrl-L tools might be enough for some
purposes.
when you use the Ctrl-L feature, the drawing you make is added to the
imported picture in a way that can be separated with relative ease.
make some experiments an see for yourself. So you might draw your
graph manually with Ctrl-L tools and than separate and discard the
original picture.

M.Roellig

unread,
Sep 17, 2010, 6:42:07 AM9/17/10
to
0 new messages