Editor's Note: Popular File 2018
GRABIT Extracts data points from an image file.
GRABIT starts a GUI program for extracting data from an image file. It is capable of reading in BMP, JPG, TIF, GIF, and PNG files (anything that is readable by IMREAD). Multiple data sets can be extracted from a single image file, and the data is saved as an n-by-2 matrix variable in the workspace. It can also be renamed and saved as a MAT file.
Following steps should be taken:
1. Load the image file.
2. Calibrate axes dimensions. You will be prompted to select 4 points on the image.
3. Grab points by clicking on points. Right-click to delete a point. Image can be zoomed during this stage.
4. Multiple data sets will remain in memory so long as the GUI is open. Variables can be renamed, saved to file, or edited in Array Editor.
Panning is achieved by clicking and dragging on the image. In addition to using the zoom button, there are keyboard shortcuts for zooming:
<shift> - center view
<a> - zoom in
<b> - zoom out
<space> - reset view
This code will also work for extracting data points from a tilted or a skewed image (even upside-down or mirrored). The calibration stage ensures that the imperfect orientation or quality of the image is accounted for.
The types of files that will most likely work are BMP, JPG, TIF, GIF (up to 8-bit), and PNG files. Basically, any format supported by the IMREAD is accepted.
GRABIT(FILENAME) will start the GUI program and open the image file FILENAME.
Type GRABIT('-sample') to load a sample image.
Created in MATLAB® R13. Tested up to R2006a
jiro (2019). GRABIT (https://www.mathworks.com/matlabcentral/fileexchange/7173-grabit), MATLAB Central File Exchange. Retrieved .
1.0.0.1 | Updated license |
|
1.0.0.0 | Fixed bug. Now, grayscale images can be loaded. |
|
Fixed loadImageFcn bug. |
||
Added mouse features: double-click to center view. right-click and drag to zoom. other minor code changes. |
||
Added mouse features: double-click to center view. right-click and drag to zoom. other minor code changes. |
||
Animate view change and zooming for a better visual perception. |
||
Bug fix (typo) |
||
Major code change. Added zoom feature during calibration. Added panning feature. |
||
Use IMAGE instead of IMSHOW for compatibility (does not require Image Processing Toolbox). |
||
Use IMAGE instead of IMSHOW for compatibility (does not require Image Processing Toolbox). |
||
Use IMAGE instead of IMSHOW for compatibility (does not require Image Processing Toolbox). |
||
Added the functionality to start the GUI and opening an image file from the command line. Also embedded a sample image file into the fuction. Type 'grabit -sample'. |
||
Added the functionality to start the GUI and open an image file from the command line. Also embedded a sample image file to the function. Type 'GRABIT -sample'. |
Inspired: GRABIT - POLYFIT, INTERACTIVEMOUSE, SMIProm
Create scripts with code, output, and formatted text in a single executable document.
Joe Bevis (view profile)
Very good
Alex Blum (view profile)
Does not work with 2018b or 2019a. At the step "Click on ORIGIN of x-axis" the GUI will not accept any inputs, or proceed to the next step in calibration.
Felix Frank (view profile)
Anilcan Taner (view profile)
Works like a charm. Really helped me a lot. I may even use this in my thesis works since I work with many different uncommon graphs that it is hard to get formulations or informations about. But I don't know if it would be " right " in terms of scientific work.
Yuheng Wu (view profile)
Gerry Zhang (view profile)
Amir Hassanfiroozi (view profile)
Love it, thanks
Kuifeng Zhao (view profile)
Easy to use. Works well.
Travis Petersen (view profile)
Wonderfully simple and straightforward.
mohan kanth (view profile)
Joris Meurs (view profile)
Robert Danforth (view profile)
Work perfect. Thanks so much!
Amit Singh (view profile)
Very comfortable in using. Thanks
saeid zendegan (view profile)
saves a lot of time
Vehzan Rustomji (view profile)
Basit Abdul (view profile)
Qihao Yu (view profile)
Very convenient. Thanks!
Vagner (view profile)
Very good! I have tried with different softwares and the results from grabit agree very well, thought more easy.
Chad Greene (view profile)
Fantastic. Really streamlines the process of digitizing and saving plots from published papers. Thanks Jiro!
Aniket Patil (view profile)
Very useful
CE (view profile)
Pranay Jain (view profile)
brilliant!
Carlos Figueiredo (view profile)
Nicely done!
DAYANAND SELVARAJAN (view profile)
Not working :(
I loaded the JPG, when I run GRABIT with my filename, it shows me nothing.
I'm using 2018b.
Please do suggest me.
Michael Himmelhaus (view profile)
Great, exactly what I needed.
Edward Longman (view profile)
Jack Bi (view profile)
Very beautiful.
Kai Mun Chan (view profile)
very good for linear. drawing a plot based on log scale picture is a bit tricky. What i did was i plotted and got the values for my graph. For those values, I had to times it by 10^-2 and used loglog to remake a very similar graph compared to the scanned copy. Otherwise, amazing work.
David Rivas (view profile)
Nicely done!
Jose Ortega (view profile)
BERGHOUT Tarek (view profile)
Kirk Dolan (view profile)
Ufuk Tamer (view profile)
Nidhi (view profile)
good
Baha411 (view profile)
I forgot to give *****
And never mind the log scale question; using this tool and picking points with respect to power of 10 will give log scale powers. Then plotting those values as 10^picked points should give the log scale data if I am not wrong!
Baha411 (view profile)
Can you add a capability to do the same thing in log scales?
Dick Sterenborg (view profile)
Great program. Simple and works well. Indeed log scales might come in handy, although not essential.
Maia Szalavitz (view profile)
Tobias Kistler (view profile)
Dong Zhang (view profile)
mohanasundaram shanmugam (view profile)
zehavit (view profile)
thong ly (view profile)
Very very good! Thanks.
Vikas Sharma (view profile)
Really great work. Plz, resolve some common issues like semilog,log-log axes. Some error on the draw now "Warning: The DrawMode property will be removed in a future release. Use the SortMethod property instead. " can also be resolved.
Many thanks in advance.
MOHAMED ALKASSEM ALOSMAN (view profile)
Brilliant thanks
Govindaraj P (view profile)
Very useful. Thank you jiro.
Josep Guasch (view profile)
Very useful, thanks for the work!
Safwana Razak (view profile)
Umut Pekdüz (view profile)
Victor Quezada (view profile)
Amazing!
Israel Jesus Arocutipa Escobar (view profile)
it's brilliant
Davide Vatteroni (view profile)
Peter Sassan Johansson (view profile)
Amazing script!
Jatin Gera (view profile)
Alexander May (view profile)
Simply brilliant! Thank you!
Josh (view profile)
F H (view profile)
Thank you so much for that awesome tool. I've used it plenty of times over the years. Keep up the good work!
Tomas Hulan (view profile)
A perfect tool! Thanks!
Chuchu Xiang (view profile)
Kay Ackermann (view profile)
Sameh Khan (view profile)
Excellent code. FTI for those struggling with Drawmode, Erasemode deprecation.
Replace:
'drawmode' . , 'fast', ...
WITH
'SortMethod' , 'depth', ...
and delete 'Erasemode', 'normal'
Your code should work fine in newer versions of MatLab, if those are the only issues.
Alex Dokoutchaev (view profile)
Miguel Chavez (view profile)
Mohammed Alam (view profile)
Caroline Pavlak (view profile)
Jinpu Lin (view profile)
Ricardo Brito (view profile)
Fernando Zigunov (view profile)
Ashwin Pathak (view profile)
Which is the latest version of MATLAB for GRABIT command to work. Anyone?
Athavan (view profile)
For those who want to grab datapoints from a log-log graph, you can apply a simple transformation. For calibration, select points that are integer decades apart, then specify the decade (ex 3x10^1 -> 1, 3x10^4 -> 4) for the calibration values.
Once the data is grabbed, just apply the following transformation: [x, y] -> [constant1*10.^x, constant2*10.^y]. For example, where one axis limits are from 3x10^1 to 3x10^4, then the constant is 3. One such transformation can be executed as the following: a1 = [3*10.^Data001(:,1) 10.^Data001(:,2)];
Álvaro Romero Calvo (view profile)
Nicolas (view profile)
Mattia (view profile)
Not supporte by R2017a :-(
Chuhan Deng (view profile)
Great Functions!
Naftali Herscovici (view profile)
Great utility! Thanks!
Federico Danzi (view profile)
An extremely useful tool! Thanks!
zhumei sun (view profile)
does it work for double Y axes?
Lucia Mascotelli (view profile)
Is it possible to use it when one axis is in log scale and not linear?
mod rany (view profile)
Really great tool. I would suggest to build in an interpolation as a post processing option.
Vikram Babu (view profile)
Great tool to extrapolate raw data from stress-strain curve images. Thanks for a great macro Jiro!
Wenyin Gong (view profile)
Harish Sasikumar (view profile)
kelvin zhang (view profile)
good
Dennis Vogt (view profile)
Slim Shady (view profile)
How to make this understand that an axis is on log scale
Nick Savino (view profile)
Effective tool. Useful with stress-strain curves
Nick Savino (view profile)
tian chang (view profile)
GLC (view profile)
Pedro (view profile)
Perfect
Sarvenaz Chaeibakhsh (view profile)
Milad Jalali (view profile)
rcbb (view profile)
Isaac Gentle (view profile)
MMZ (view profile)
Alessandro Cancelli (view profile)
William Afonso (view profile)
Abdulaziz Abutunis (view profile)
Great tool.. Thank you
Antoine Debugne (view profile)
Martin Erinin (view profile)
jamisojo (view profile)
Abhijeet chausalkar (view profile)
Kang Gao (view profile)
Nitisha Ahuja (view profile)
How can I use it for log log plot?
Tunechi (view profile)
Very useful function,
Lama Hamadeh (view profile)
this code is pretty useful to get the x and y pixels of any jpeg image (or any other types of images). However, if I have a jpeg thermal image and I need to extract the temperature data from it, i.e., the value beneath each point (xpixel,ypixel), this code is not useful.
P.S: ginput function in MATLAB does, to some extent, the same job as this code.
Haibin Pan (view profile)
It's great.Thanks the author.
Muzaffer Ozsecen (view profile)
Paolo Di Re (view profile)
When I grab a point, the function draws a red dot on the image.
Is there a way to change the color of the dot from red to another color, for instance cyan, even by modifing the function? Thanks
Raghavendra Arunachala (view profile)
Great tool.
How to extract the data points if the one of the axis is in logscale? For e.g. yaxis in log scale.
xingya chen (view profile)
good
Kurt Duclos (view profile)
Great GUI. If you could set it for a semilogy, semilogx, or loglog instead of linear only, that would be incredible. Also, the cursor accuracy when grabbing data points be improved by making it more like the cursor when selecting the X, Y axes.
Dale Smith (view profile)
shiwen wang (view profile)
Thank U so much!
NAGA VBN (view profile)
MG (view profile)
I like the interface and resolution allowed by the algorithm. However, when I tried using on a plot, it consistently is not correctly scaling my "grabbed" points to neither the min-max x or y coordinates that I input.
Beichuan Hong (view profile)
Thx for this file!
Caroline Loss (view profile)
excellent tool!
thank you so much!
MM (view profile)
Joeylee (view profile)
good
Joeylee (view profile)
Nabin Paudel (view profile)
Error message, unable to expand "grabit.zip" into downloads. Any solutions for this issue yet ?
vkehayas (view profile)
Rosemary Le (view profile)
There is an error message when attempting to unzip the file:
"Unable to expand "grabit.zip" into "Downloads".
(Error 1 - Operation not permitted.)"
Just wanted to notify --
HenryatNU (view profile)
It seems quite useful, but on OSX 10.11.6, Version R2016a, it warns me of 2 deprecated properties which "may go away in future releases." (DrawMode and EraseMode) So it looks like it needs an update. If I can I may try to update this as it might be a good chance for learning some new things for me.
I found that it's a little tricky to set up the axes as the cursor is quite fine, but that is an advantage really. One needs to be careful and practice a bit. Also Log plots need you to choose the exponent so again a tad tricky but practice should help. Not obvious how else you could do it. And "max" really does mena the maximum value on the scale.
Prabhat Chandra (view profile)
Srikanth Divi (view profile)
rahul verma (view profile)
How we can save the image, after garbing points.
is there any way to get the selected image.
Chenguang Zhang (view profile)
great tool!
Yonatan Calahorra (view profile)
Thank you for this!
GE (view profile)
Shabareesh Kumar (view profile)
this is a very use full application,
Thank you
Tai Yunxin (view profile)
Qiyan Lian (view profile)
It is really a amazing GUI,but there is a warning, EraserMode will not be supported.so it should be updated.
Qiyan Lian (view profile)
Aditya (view profile)
Really easy and straightforward to use. No unnecessary complications or extra features. Works great!
Gabriel (view profile)
Benjamin Cheong (view profile)
Mohammad Mohammadi (view profile)
Zac Milne (view profile)
I use this all of the time for analyzing data from others' work. I wish there was a function to deal with log axes.
Paul Martin (view profile)
Just what the doctor ordered, worked well first time. Thank you Jiro!
Paul
Deepan J (view profile)
Euler Oliveira (view profile)
It worked well and helped me a lot. Thanks!
Jake G (view profile)
Great software, it was a little dated so I needed to tweak it a bit to deal with log scale axis and get rid of those annoying warnings.
Erik (view profile)
Hoang Anh Nguyen (view profile)
like
Robert Richardson (view profile)
Very useful software! Very intuitive and easy to use. Exactly what I needed.
Zhang Wenqiang (view profile)
very good software, so much thanks!
Emon (view profile)
Excellent. Thanks a lot.
Joris Meurs (view profile)
Great work! Very useful
Mustafa (view profile)
Very useful code. This is what I was looking for. Thanks
Ivan (view profile)
Andrew Stamps (view profile)
This has been a great utility for me over the years. However, it appears to be showing its age with the new graphics system. I am now seeing the following warnings when starting the tool:
Warning: The DrawMode property will be removed in a future release. Use the SortMethod property instead.
> In grabit (line 471)
Warning: The EraseMode property is no longer supported and will error in a future release. Use the ANIMATEDLINE function for animating lines
and points instead of EraseMode 'none'. Removing instances of EraseMode set to 'normal', 'xor', and 'background' has minimal impact.
gdowdy (view profile)
Exactly what I needed. The only thing that was not intuitive to me was hitting [ENTER] to indicate that I was done specifying each axis.
mohit raghuwanshi (view profile)
PERFECT
Use (view profile)
aaron pung (view profile)
Straight-forward, simple, and gave me everything I was looking for, and much more.
- Upload image file
- Choose/define X,Y axes
- Zoom/Pan to area of interest
- Click to record desired datapoints
- Plot is generated in real-time
- Data table can be saved for further processing!
Erik Reinertsen (view profile)
Worked well for simple data point extraction from a PNG.
For those of you getting the error "unexpected matlab operator", make sure you call "addpath" and add the directory in which this .m file is stored. The main function calls other functions within the .m file.
Dimani4 (view profile)
amazing program!!!! thank you very much!!!!
KSSV (view profile)
keivan80 (view profile)
Thank you so much . It was so usefull
Alejandra Matamoros (view profile)
Rahul (view profile)
Super! This just saved me quite a bit of work. Thank you.
Xin (view profile)
Yuan Feng (view profile)
Gabriel Chatterjee (view profile)
excellent work a nice tool
Edgar (view profile)
I wonder if there is a way to automatically recognize the waves if the image has a wave of a unique color and if there is a way to do multiple files instead of clicking points one by one. Thanks!
Matthias Eberlein (view profile)
Does make my life easier, thank you
Faezeh F (view profile)
That's great. Thank you very much!
daniel (view profile)
WOW!! Absolutely beautiful, I love it, thanks!!!!
ANDRÉ KUCHIISHI (view profile)
Punit (view profile)
For people asking about logarithmic axis...
You can put the values for calibration of log axis as 1, 2, 3 instead of 10, 100, 1000, and then when you plot the data just take 10^(axisValues).
Konstantin (view profile)
Best, Thanks
Nikolay (view profile)
Bikash (view profile)
It is working fine. Nice work.
Ole (view profile)
How does it work with log axis ?
Thank you.
Nikhil (view profile)
Nitin (view profile)
Abhishek Anchal (view profile)
Nice work Jiro. Liked it. Very useful for me.
Amit (view profile)
Keith Lindsay (view profile)
Andrew Stamps (view profile)
This has been a very useful submission for me. One minor improvement that I could suggest is an option to recalibrate the x-axis and y-axis independently. I think that would be great for plots with multiple y axes.
Yukyung (view profile)
Won't work in 2013b though
Roberto Herrera (view profile)
Yuji Zhang (view profile)
Works so well! Thank you for your contribution Jiro~
Suggestion: automatic recognize curve (if possible)
Adrian Lara-Quintanilla (view profile)
arnold (view profile)
thanks Jiro, great tool. If you find the time, why don't you go and put in a way to select a continuous color (a line) for instance. This would make clicking along a closed plot unecessary. What do you think ;)
Danny Sale (view profile)
Worked perfectly for me. This is one of the best implementations of a plot digitizer I have ever used. Thanks for sharing your excellent work!
Francesco (view profile)
Great tool!
Does exit an updated version to deal with logarithmic axes?
Or maybe some one could give me some clue to implement it in the code... thanks
Zhen Chen (view profile)
Luke (view profile)
Ahmed Ali (view profile)
Many thanks for you, you have solved a very complex problem for me
James Herman (view profile)
mike (view profile)
Thanks for the great tool. I'm currently trying to adapt it a little bit for my use, and bit of help would be appreciated.
I have a bunch of images from which I plan to grab data. However, they only have y axis reference points, so I can't calibrate them properly. The x-axis is on the same scale as the y-axis, so what I want to do is force the origins of both axes to be at the same location. Then I can force the horizontal distance (on screen) between Xo and Xmax to be the same as the vertical distance between Yo and Ymax. However, I don't really understand how the locations of the calibration points are stored and used, so I'm having trouble.
Oscar (view profile)
It is very helpful, veru well done
quadro1327 (view profile)
very nice tool!
Thomas (view profile)
Nassim Khaled (view profile)
Whitney (view profile)
There are several versions of this type of GUI on the exchange, but this is by far the best one. It incorporates all of the stuff that the other guys are missing, plus the interface is very easy to use. I especially like that it can handle skewed images from really old scanned papers.
Matthew (view profile)
Awesome!
Enrico Segre (view profile)
Nice Gui, but miss an automatic curve recognition. I'm also using reverseplot
(http://www.mathworks.co.uk/matlabcentral/fileexchange/4316-reverseplot), which has this feature, but a slightly inferior gui.
Ram Lakshmi (view profile)
Hello,
Thanks for this nice tool.
Instead of point, can I get an area by marking a particular region in the bit map.
Regards
Ram
Torsten Vogel (view profile)
Donat-Pierre Luigi (view profile)
This a great application. I would have one request. Would it be possible to calibrate to the image size, with origin at top left max Y at bottom-left and max X at top-right. It is very basic and not as general as the current calibration procedure using 4points.
I am having issues with zoom and ginput to get the coordinate of a point in an image to change the coordinate system to that point later on in pixel and physical units. Thanks.
Brian (view profile)
A very useful application.
GREAT GREAT GREAT WORK!!!!
Excellent tool - best one of these I've used so far. Log axes? No problem, just type in the exponent as the calibration values.
Suggestions:
* Ask the user if the data should be adjusted if the user recalibrates after grabbing.
* If the scan is not perfectly horizontal it would be nice to have two adjustment points for each xmin, xmax, ymin, and ymax - i.e. support for rotated coordinate transformation.
Super tool!
Need the capability to use log-axes though.
This is one of the best and most useful tool I found here: really compliments!
GREEEEAT,
Is it possible that in the preview box shows the position calibrated and the corresponding pixel?
I plan to use it to calibrate a video to follow a laser spot
This program is ingenious. It is extremely small, easy to use and yet so useful that it makes it the ultimate grab tool.
This script is a lot better than Datathief which I formerly used. It makes extracting data from figures easier and faster!
Does not work. from the first line itself it says unexpected matlab operator..
please help. i think its not identifying 3d
i am using matlab 7.1.0.246 (R14)
Does not work. from the first line itself it says unexpected matlab operator..
please help.
i am using matlab 7.1.0.246 (R14)
for the last six month i am trying to extract the data from the image file. Now i got it. this is very well work for me and all (those who are working Scientific data processing).
Thanks a lot. Good Job.
This is something I was looking for. Thank You. Tip: wouldn't it be nice to extract data point form graphs with logaritmic axes?
Just loved it. Very good interface also.
Very usefull,
Extremely useful. Thank you very much for sharing.
Excellent tool. Thanks for posting.
very useful tool. Thanks a lot.
excellence! I am waiting for the next version which can deal with logarithmic axis. Good luck!
I have uploaded an improved version. It has a better zooming feature (also zoomable during calibration) and a click-n-drag panning feature. I have not yet implemented capability to deal with LOGARITHMIC axes, but that's on my to-do list.
A very useful utility. Suggested additions and improvements are:
1) facility to deal with logarithmic as well as linear axes.
2) allow zoom function to work in calibration mode as well as in data grabbing mode so that axis limits can be defined more accurately.
Sorry, but wenn I start your code, I can see only GUI. If I browse a filename (Load Image) - only a path and image name will be shown, but I can´t see anything... Please inform me what to do, thanks
The imshow command used at line 382 ('iH = imshow(A, map)') does not work in MATLAB R14 SP2. Replacing it with 'iH = image(A);
colormap(map);' solves the problem. Other than that a very useful but of code!
A very good code. I have tried it, it works well.
good piece of code. useful for retrieving data points from images.
perfect... would suggest to improve on finding data automatically when clicked on any particular line on the image