Matlab EPS data extraction

Sometimes it appears to be useful to have more detailed knowledge of point data than just the plot of it – taking a ruler and measuring out coordinates of points within a diagram is simply not an option. If this plot is available in a suitable vector format such as PostScript, then it is in principle possible to read out the original data again (up to the accuracy of the plot itself).

In the case of diagrams generated with MATLAB, I can offer a little Perl-script to do this job. Appart from extracting the point sets (one CSV file is generated for each point set, PS point coordinates sit in the first two columns) it also tries to read the axes and offer a transformation from the PS coordinate system to the original one (column three and four, if available).

Keep in mind, that this is just a 15-minutes quick-and-dirty hack which works for the plots I was interested in. If you encounter any problems, write me a note. In principle, the same technique would also work for other programs such as gnuplot.

Download: matlab_extract.pl