1 view (last 30 days)
Anilcan Taner on 9 Nov 2019
Commented: Star Strider on 9 Nov 2019
Let's say we have a graphic which consinst of x axis and y axis, but the shown lines in graphic are gathered from many experimental data's and we can't reach to those informations. So we are left with only graphic. To make situation worse we just have pdf version of the graphic.
In this case, how can we make a program which will read values from this graphic?
The question might be awkward. Im die-hard newbie in programming. I just wanted to ask and see what you guys would think about this.

Star Strider on 9 Nov 2019
Click on this link to launch a File Exchange search for functions that scan and import data from a printed plot. One popular file appears to be GRABIT.

Star Strider on 9 Nov 2019
The limitation on the points may be the result of the native figure resolution. There is likely nothing you can do about that.
Two options for creating more points from your available data:
xv = linspace(min(x), max(x), 150); % Linear Vector
yv = interp1(x, y, xv, 'linear'); % Interpolation (Option #1)
B = polyfit(x, y, 3); % Polynomial Fit (Option #2)
yv = polyval(B, xv); % Polynomial Fit (Option #2)
figure
plot(x, y, '.', xv, yv, '-r')
grid
I would not normally suggest interpolating either using interp1 or polyfit/polyval, however this may be appropriate for what you want to do. (I would not use more than a 3-degree polynomial fit.)
The ‘Fig1.fig’ figure appears to have all the lines, so you can select them and do the same sort of interpolation. It would likely be best to use the same ‘xv’ for all of them, since all the interpolated dependent variable values would then have the same independent variable values. (It does not need to be the same ‘xv’ I chose here. Choose the start-end and vector-size values that best fit your needs.)
Walter Roberson on 9 Nov 2019
Note: a while back I went through and tagged all of the File Exchange submissions on this topic, all with the tag "digitize". So you can find a variety of similar programs by searching on https://www.mathworks.com/matlabcentral/fileexchange/?term=tag:%22digitize%22
Star Strider on 9 Nov 2019
@Walter — I wasn’t aware of that! Thank you!