# Program to extract data from a graph

**URL:** https://boards.straightdope.com/t/program-to-extract-data-from-a-graph/561735
**Category:** Factual Questions
**Created:** [November 24, 2010, 2:25am UTC](https://boards.straightdope.com/t/program-to-extract-data-from-a-graph/561735 "2010-11-24T02:25:37Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![Chronos](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/chronos/32/134_2.png) [@Chronos](https://boards.straightdope.com/u/Chronos)
#### Post date: [November 24, 2010, 2:25am UTC](https://boards.straightdope.com/t/program-to-extract-data-from-a-graph/561735/1 "2010-11-24T02:25:37Z")

</div>

I find myself in possession of a printout of a graph, from which I need to reconstruct the data that was used in making the graph (unfortunately, my advisor never bothered to save the data itself). I’ve already scanned in the graph and cleaned up the image so that the lines can be distinguished (from each other and from the assorted scribbles that were marked on the graph), but now I need something that’ll read those lines and output data in some usable format, such as an ASCII table. I found a program online called DigitizeIt that seemed to work, but it’s crippleware, and won’t let me save the output, or copy it to the clipboard, unless I pay $50. Everything else I found only works on Windows or Linux (I’m on OSX). Any suggestions?

---

<div class="post-metadata">

### Author: ![robert\_columbia](https://avatars.discourse-cdn.com/v4/letter/r/e79b87/32.png) [@robert\_columbia](https://boards.straightdope.com/u/robert_columbia)
#### Post date: [November 24, 2010, 2:49am UTC](https://boards.straightdope.com/t/program-to-extract-data-from-a-graph/561735/2 "2010-11-24T02:49:39Z")

</div>

> [@Chronos](#):
>
> I find myself in possession of a printout of a graph, from which I need to reconstruct the data that was used in making the graph (unfortunately, my advisor never bothered to save the data itself). I’ve already scanned in the graph and cleaned up the image so that the lines can be distinguished (from each other and from the assorted scribbles that were marked on the graph), but now I need something that’ll read those lines and output data in some usable format, such as an ASCII table. I found a program online called DigitizeIt that seemed to work, but it’s crippleware, and won’t let me save the output, or copy it to the clipboard, unless I pay $50. Everything else I found only works on Windows or Linux (I’m on OSX). Any suggestions?

Manual analysis and data entry?

Is this a continuous graph, or discrete? If it’s continuous, you could pick a reasonable sampling density (depending on curved the curve is, etc), such as 5mm, and measure the height from zero and at the end of each interval, using a ruler, then type in the readings you get.

Hire someone to do it?

---

<div class="post-metadata">

### Author: ![wheresmymind](https://avatars.discourse-cdn.com/v4/letter/w/91b2a8/32.png) [@wheresmymind](https://boards.straightdope.com/u/wheresmymind)
#### Post date: [November 24, 2010, 4:21am UTC](https://boards.straightdope.com/t/program-to-extract-data-from-a-graph/561735/3 "2010-11-24T04:21:39Z")

</div>

A friend of mine was raving about how awesome one of these programs was last year. I’m not positive but [GetData](http://www.getdata-graph-digitizer.com/) sounds familiar. If that’s not up to snuff, googling “digitizing data from graph” will give you a dozen or so freeware/shareware options.

---

<div class="post-metadata">

### Author: ![HighFructose](https://avatars.discourse-cdn.com/v4/letter/h/87869e/32.png) [@HighFructose](https://boards.straightdope.com/u/HighFructose)
#### Post date: [November 24, 2010, 4:36am UTC](https://boards.straightdope.com/t/program-to-extract-data-from-a-graph/561735/4 "2010-11-24T04:36:01Z")

</div>

I’ve used [Engauge](http://download.cnet.com/Engauge-Digitizer/3000-2053_4-47734.html) on Windows and Linux. The linked version for OSX is slightly dated, but it should work for your needs.

---

<div class="post-metadata">

### Author: ![\_Undecided\_Adrian](https://avatars.discourse-cdn.com/v4/letter/_/eada6e/32.png) [@\_Undecided\_Adrian](https://boards.straightdope.com/u/_Undecided_Adrian)
#### Post date: [November 24, 2010, 8:06am UTC](https://boards.straightdope.com/t/program-to-extract-data-from-a-graph/561735/5 "2010-11-24T08:06:41Z")

</div>

They’re using Engauge at my Uni as well.

---

<div class="post-metadata">

### Author: ![si\_blakely](https://avatars.discourse-cdn.com/v4/letter/s/d9b06d/32.png) [@si\_blakely](https://boards.straightdope.com/u/si_blakely)
#### Post date: [November 24, 2010, 8:15am UTC](https://boards.straightdope.com/t/program-to-extract-data-from-a-graph/561735/6 "2010-11-24T08:15:22Z")

</div>

Back in the 90s I wrote a piece of software to do this sort of thing, interfaced to a 18" digitizer tablet. With a cross-hair puck it was really accurate at extracting data. It could even cope with skewed axes and multiple datasets. It was a pretty cool bit of software, but the problem was that the printed graphs we started on were not big enough to give any real resolution, even blown up on a photocopier. It was good for graph recreations, though. I guess it is long gone now.

Si

---

<div class="post-metadata">

### Author: ![BigT](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/bigt/32/12044_2.png) [@BigT](https://boards.straightdope.com/u/BigT)
#### Post date: [November 24, 2010, 8:18am UTC](https://boards.straightdope.com/t/program-to-extract-data-from-a-graph/561735/7 "2010-11-24T08:18:34Z")

</div>

> [@HighFructose](#):
>
> I’ve used [Engauge](http://download.cnet.com/Engauge-Digitizer/3000-2053_4-47734.html) on Windows and Linux. The linked version for OSX is slightly dated, but it should work for your needs.

Do PPC apps still work on Intel Macs?

---

<div class="post-metadata">

### Author: ![HighFructose](https://avatars.discourse-cdn.com/v4/letter/h/87869e/32.png) [@HighFructose](https://boards.straightdope.com/u/HighFructose)
#### Post date: [November 24, 2010, 9:45am UTC](https://boards.straightdope.com/t/program-to-extract-data-from-a-graph/561735/8 "2010-11-24T09:45:04Z")

</div>

> [@BigT](#):
>
> Do PPC apps still work on Intel Macs?

Good question..one that I am not equipped to answer. Here’s the [source](http://digitizer.sourceforge.net/) that does require some [dependencies](http://digitizer.sourceforge.net/index.php?c=5) if you choose go that route. Not sure if there is a precompiled version for Intel Mac OSX out there. Sorry if I was a bit misleading, but I the OP didn’t specify hardware and I’m not a regular Mac user.

---

<div class="post-metadata">

### Author: ![septimus](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/septimus/32/410_2.png) [@septimus](https://boards.straightdope.com/u/septimus)
#### Post date: [November 24, 2010, 10:45am UTC](https://boards.straightdope.com/t/program-to-extract-data-from-a-graph/561735/9 "2010-11-24T10:45:57Z")

</div>

Probably not what you’re looking for, but it would be straightforward to write your own simple software to do this. Once you’ve cleaned up the image and stored it in a simple format like PPM, you can locate pixels of desired color with something as simple as grep, and develop (x,y) coordinates easily from pixel location.

Depending on your skill set, this could be simpler and more fun than tracking down pre-written software to do the same thing.

---

<div class="post-metadata">

### Author: ![BigT](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/bigt/32/12044_2.png) [@BigT](https://boards.straightdope.com/u/BigT)
#### Post date: [November 24, 2010, 11:00am UTC](https://boards.straightdope.com/t/program-to-extract-data-from-a-graph/561735/10 "2010-11-24T11:00:35Z")

</div>

> [@HighFructose](#):
>
> Good question..one that I am not equipped to answer. Here’s the [source](http://digitizer.sourceforge.net/) that does require some [dependencies](http://digitizer.sourceforge.net/index.php?c=5) if you choose go that route. Not sure if there is a precompiled version for Intel Mac OSX out there. Sorry if I was a bit misleading, but I the OP didn’t specify hardware and I’m not a regular Mac user.

Actually, I should have just checked for myself. I had heard that Rosetta (which runs PPC apps on Intel Macs) was not included in Mac OS X Snow Leopard. But it seems it’s [just not installed by default](http://docs.info.apple.com/article.html?path=Mac/10.6/en/27987.html). So a PPC version should still work.

---

<div class="post-metadata">

### Author: ![Chronos](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/chronos/32/134_2.png) [@Chronos](https://boards.straightdope.com/u/Chronos)
#### Post date: [November 24, 2010, 6:13pm UTC](https://boards.straightdope.com/t/program-to-extract-data-from-a-graph/561735/11 "2010-11-24T18:13:19Z")

</div>

OK, maybe I’m just dense, but I downloaded Engauge, and I’m seeing all sorts of documentation, auxiliary files, readmes, and so on, but no executable or app. The instructions tell me to untar the executable release package, and then to look for engauge.app , but I can find neither an executable release package nor an app.

---

<div class="post-metadata">

### Author: ![Squink](https://avatars.discourse-cdn.com/v4/letter/s/b5e925/32.png) [@Squink](https://boards.straightdope.com/u/Squink)
#### Post date: [November 24, 2010, 7:43pm UTC](https://boards.straightdope.com/t/program-to-extract-data-from-a-graph/561735/12 "2010-11-24T19:43:09Z")

</div>

[NIH Image](http://rsbweb.nih.gov/nih-image/) used to do the sort of thing you’re looking for.  
Looks like it’ll run in System 9 emulation under OSX, if you can manage that w the Mac you’ve got, which I doubt.

[The Faq](http://rsbweb.nih.gov/nih-image/manual/faq.html#osx) recommends [ImageJ](http://rsb.info.nih.gov/ij/), which runs native on Modern, Intel Macs: [Download](http://rsb.info.nih.gov/ij/download.html)

I’ve never tried it.

---

<div class="post-metadata">

### Author: ![Stranger\_On\_A\_Train](https://avatars.discourse-cdn.com/v4/letter/s/13edae/32.png) [@Stranger\_On\_A\_Train](https://boards.straightdope.com/u/Stranger_On_A_Train)
#### Post date: [November 24, 2010, 8:17pm UTC](https://boards.straightdope.com/t/program-to-extract-data-from-a-graph/561735/13 "2010-11-24T20:17:13Z")

</div>

> [@septimus](#):
>
> Probably not what you’re looking for, but it would be straightforward to write your own simple software to do this. Once you’ve cleaned up the image and stored it in a simple format like PPM, you can locate pixels of desired color with something as simple as grep, and develop (x,y) coordinates easily from pixel location.

I used a couple of the digitizing packages but was never entirely satisfied with the result (when dealing with spiky data), so I’ve written scripts in Matlab a couple of times to import an image and scan it for data. This is like fifty or sixty lines of code itself, although I’ve done it as part of a larger application to filter and analyze the data. You should be able to do the same in _Mathematica_, Octave, Scilab, SciPy, sagemath, or whatever scientific computing scripting tool you prefer; anything with image processing and numerical function capabilities.

Stranger

---

<div class="post-metadata">

### Author: ![Pleonast](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/pleonast/32/1183_2.png) [@Pleonast](https://boards.straightdope.com/u/Pleonast)
#### Post date: [November 24, 2010, 8:59pm UTC](https://boards.straightdope.com/t/program-to-extract-data-from-a-graph/561735/14 "2010-11-24T20:59:25Z")

</div>

If it’s just one graph, you don’t need anything fancy. Load the image into Matlab and use ginput() to manually sample the data at whatever spacing you like. Use the same process to get the coordinates of the axes of the graph. Apply some linear interpolation to transform pixel coordinates into data coordinates.

---

<div class="post-metadata">

### Author: ![Stranger\_On\_A\_Train](https://avatars.discourse-cdn.com/v4/letter/s/13edae/32.png) [@Stranger\_On\_A\_Train](https://boards.straightdope.com/u/Stranger_On_A_Train)
#### Post date: [November 24, 2010, 9:09pm UTC](https://boards.straightdope.com/t/program-to-extract-data-from-a-graph/561735/15 "2010-11-24T21:09:14Z")

</div>

“[x, y] = ginput” is okay if you just need to grab a few data points, but it is clunky if you have a large set of highly varying data, especially if it is oscillatory or noisy. In that case, you want to sample your data (and if the curve is thicker than a couple of pixels, the high and low) and then use an algorithm to find the local mean and filter out the garbage.

Stranger

---

<div class="post-metadata">

### Author: ![Anaglyph](https://avatars.discourse-cdn.com/v4/letter/a/ed8c4c/32.png) [@Anaglyph](https://boards.straightdope.com/u/Anaglyph)
#### Post date: [November 25, 2010, 10:20am UTC](https://boards.straightdope.com/t/program-to-extract-data-from-a-graph/561735/16 "2010-11-25T10:20:59Z")

</div>

I have not tried it, but [DigitizeIt](http://www.digitizeit.de/) probably does what you want to do. There’s a 21 day free evaluation period in which you can try it for free.

---

<div class="post-metadata">

### Author: ![Chronos](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/chronos/32/134_2.png) [@Chronos](https://boards.straightdope.com/u/Chronos)
#### Post date: [November 25, 2010, 6:59pm UTC](https://boards.straightdope.com/t/program-to-extract-data-from-a-graph/561735/17 "2010-11-25T18:59:49Z")

</div>

DigitizeIt was the first one I tried. The free version is crippled into worthlessness: You can extract the values, but you can’t get them out of the application.

---

<div class="post-metadata">

### Author: ![Chronos](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/chronos/32/134_2.png) [@Chronos](https://boards.straightdope.com/u/Chronos)
#### Post date: [November 27, 2010, 2:08am UTC](https://boards.straightdope.com/t/program-to-extract-data-from-a-graph/561735/18 "2010-11-27T02:08:08Z")

</div>

In case anyone’s still wondering, I ended up getting the Windows version of Engauge, and running it under Wine. It worked.

---

<div class="post-metadata">

### Author: ![BigT](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/bigt/32/12044_2.png) [@BigT](https://boards.straightdope.com/u/BigT)
#### Post date: [November 27, 2010, 2:10am UTC](https://boards.straightdope.com/t/program-to-extract-data-from-a-graph/561735/19 "2010-11-27T02:10:38Z")

</div>

> [@Chronos](#):
>
> In case anyone’s still wondering, I ended up getting the Windows version of Engauge, and running it under Wine. It worked.

You know, I was going to suggest just running a Windows program in Wine. I just wasn’t looking forward to having to explain how to get Wine up and running. I shouldn’t have underestimated you. (Or maybe Wine if it’s gotten easier.)

---

<div class="post-metadata">

### Author: ![HighFructose](https://avatars.discourse-cdn.com/v4/letter/h/87869e/32.png) [@HighFructose](https://boards.straightdope.com/u/HighFructose)
#### Post date: [November 27, 2010, 6:01am UTC](https://boards.straightdope.com/t/program-to-extract-data-from-a-graph/561735/20 "2010-11-27T06:01:34Z")

</div>

> [@Chronos](#):
>
> In case anyone’s still wondering, I ended up getting the Windows version of Engauge, and running it under Wine. It worked.

Revisiting the original link that I posted, it looks like it’s just a source file and not a compiled app. Sorry about that. At the risk of again pointing you in the wrong direction, the [Fink Project](http://www.finkproject.org/) “wants to bring the full world of Unix Open Source software to Darwin and Mac OS X.” It looks like there are many great apps [available](http://pdb.finkproject.org/pdb/index.php?phpLang=en), including engauge-digitizer. I’ll leave it to Mac experts to weigh in on the usefulness of fink, but it might be worth looking into if you anticipate running OSS that doesn’t have official Mac ports in the future.

[Next page](https://boards.straightdope.com/t/program-to-extract-data-from-a-graph/561735.md?page=2)
