How can I extract data from a plot which was made with software + a recording device.

a camera was used to video record a process and software turned it into a plot on matlab. I now want to extract the points on the plot but there are about 4500 points. Is there some kind of code i could just type in and it will return the X,Y values from the plot as a matrix or something so i can copy and process the data in excel. thanks

 Accepted Answer

Look in the File Exchange for the tag "digitize"
It is, however, always more accurate if you can get the original data instead of having to work on the plot of the data.

8 Comments

You have not given enough information about what the plot consists of. Is it lines? Is it an image? Is it a bar plot? Is it a contour plot? Are there multiple axes? Is it required to extract information from the legends and colorbars ?
update: i tried the code in the accept answer suggested in this thread https://www.mathworks.com/matlabcentral/answers/100687-how-do-i-extract-data-from-matlab-figures and i get an error saying
"Error using get
Conversion to double from cell is not possible."
any ideas?
The plot is of height vs time. So a standard 2D plot with varying "height" on the y axis. I am able to extract data points using ginput but cant get 4500 data points like that.
That error suggests to me that you have multiple line objects on the plot.
Perhaps you should zip the .fig and attach that here for us to examine.
Provided that you do not have any other images displayed at the time,
data = get(findobj(0, 'type', 'image'),'CData');
This will be a 145 x 4861 array of values each in the range 0 to 1.
this works. im just struggling to understand / work back to my actual X values which are much larger values than the ones that range from 0 - 1. For example i want to evaluate the graph at a time of 4000s and see what the height is at that point but cannot do that. Any further tips? thanks for all the help so far.
The .fig file has no record of what the original data range was.
data4000 = data(:,4000);
[max4000, max4000idx] = max(data4000);

Sign in to comment.

More Answers (0)

Categories

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!