Got Questions? Get Answers.
Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
extracting data from a scanned graph

Subject: extracting data from a scanned graph

From: Omid

Date: 24 Oct, 2009 11:33:01

Message: 1 of 6

Hi everybody,
Is there a way to import a plot in .jpeg into MATLAB and convert it to .fig such that "Data Cursor" can be used to get data values of some specific points in the graph?
Thanks

Subject: extracting data from a scanned graph

From: Dave Brackett

Date: 24 Oct, 2009 15:58:01

Message: 2 of 6

"Omid" <omid_dr@yahoo.com> wrote in message <hbuolc$27f$1@fred.mathworks.com>...
> Hi everybody,
> Is there a way to import a plot in .jpeg into MATLAB and convert it to .fig such that "Data Cursor" can be used to get data values of some specific points in the graph?
> Thanks

you can use image processing techniques for example edge detection to detect curves on the graph and extract the data in that way. or you could display the image then overlay an axes and use the data cursor or ginput to extract the position of the relevant pixels. These positions would then need scaling to suit the scale on the original graph.

Subject: extracting data from a scanned graph

From: Omid

Date: 25 Oct, 2009 07:48:01

Message: 3 of 6

I don't know anything about the image processing you meant and I think it isn't worth it for me to work on that, but the second approach seems applicable however it's a bit time consuming to get all the points coordinates using ginput to reproduce the figure. I wish there was a more straight way!

Subject: extracting data from a scanned graph

From: Dave Brackett

Date: 25 Oct, 2009 20:14:01

Message: 4 of 6

"Omid" <omid_dr@yahoo.com> wrote in message <hc0vrh$ghv$1@fred.mathworks.com>...
> I don't know anything about the image processing you meant and I think it isn't worth it for me to work on that, but the second approach seems applicable however it's a bit time consuming to get all the points coordinates using ginput to reproduce the figure. I wish there was a more straight way!

by reading in your image, you will get a matrix of numbers (the actual numbers will depend on the type of your image). For example a black and white image would give a matrix with 1s and 0s. From this you could plot the black pixels in a figure and then fit a spline to the data.

edge detection could also work (type 'help edge' in the command window). If you could supply an example image it would be easier to give suitable example lines of code back to you.

Subject: extracting data from a scanned graph

From: Omid

Date: 26 Oct, 2009 06:45:04

Message: 5 of 6

Dave,
Thanks for your help. I think I understand the procedure you mean, however I sent an image to your email address.

Subject: extracting data from a scanned graph

From: bla bla

Date: 27 Oct, 2009 23:05:37

Message: 6 of 6

extracting data is always a time consuming process, for extracting
data from documents, the web, websites, or data files, i found
http://www.extractingdata.com to be really useful, they build quick
custom web scraping and data extracting programs

Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us