View License

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Highlights from
Grab 2D points

3.8 | 4 ratings Rate this file 6 Downloads (last 30 days) File Size: 857 KB File ID: #15966 Version: 1.0
image thumbnail

Grab 2D points


Nassim Khaled (view profile)


17 Aug 2007 (Updated )

This code is used to digitize 2d figures that you find in publications, journals, or simply scanned

| Watch this File

File Information

% This code is used to digitize figures that you find in publications, journals, or simply scanned reports or documents by clicking on the desired points using the mouse.
% You can use it to pick [x,y] points by clicking on the original scanned plot.
% To run, simply type:


% and then follow the instructions
% Notes:
% 1- Plots or figures should be of jpg, png, bmp or any other format that is
% acceptable by matlab and in the same directory as these m-files you are using.
% 2- You don't have to select the points in increasing or decreasing
% order. Click wherever you want on the plot. I have written a small code
% to sort the vectors in ascending order
% 3- The [x,y] data points will be saved in GRABBED.mat. Load
% GRABBED.mat and the first column of GRABBED will be your absisca points, the second
% are the ordinates.

% This code is written by
% Nassim Khaled
% June 2007

Important:Change imshow to imagesc for people without Image Processing Toolbox.

Required Products Image Processing Toolbox
MATLAB release MATLAB 7.0.1 (R14SP1)
Other requirements Important:Change imshow to imagesc for people without Image Processing Toolbox.
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (5)
20 Oct 2011 Neeraj Agarwal

Very helpful indeed. My problem is that the y axis of the picture/figure that I am trying to get data from is a log scale. How would you suggest I manipulate the data to show that the scale is in fact a log scale and not a linear one which this script assumes? I can clarify further is the question is not clear.

Thanks, really appreciate it!

Comment only
10 Nov 2010 Whitney

This worked fairly well, but I would suggest suppressing all of the save commands. It makes it fill up any folder that you run it in with x_min.mat, x_max.mat...etc. Also, I would suggest prompting for the user for the name to save the data. The following works well:

[FileName,PathName,FilterIndex] = uiputfile('*.mat','Save File As');
save(FileName, 'X', 'Y')

Also, can this accomidate a skewed image, for example in an old school scanned image, the angle between the axis might not equal 90 degrees.

02 Oct 2007 Martin Hansson

Suggestions for improvements:
- Change imshow to imagesc to make available for people without Image Processing Toolbox.

- The matlab axis should be changed to the one in the scanned picture after given this input.

- Include log axis

- Include the possibility of rotated image (see digitization by Harald E. Krogstad)

- Don't close the "working" window

23 Aug 2007 Mohannad Hakeem

21 Aug 2007 Saad Maakaron

Comes in handy when needed.

31 Aug 2007

I have to include some .*fig files that were missing.

02 Sep 2007

I made an update on one of the m-files.

23 Jun 2008

I have made use of one of the comments to modify the submission.

Contact us