5
votes

Suppose that I have a PostScript file containing a plot which was generated using gnuplot. However, I do not have the source data, nor do I have the gnuplot commands that were used to generate the plot.

Do you know of any way to somehow extract data from a graphic representation (i.e., a PostScript file)? Such code would have to literally "read off of the graph" (in particular, I have a smoothed line/scatter XY plot) from the pixel representation, and I know that the results would be approximate at best (but this would still be very highly desirable).

Do you have any experience with this? Thank you for your time!

2
It's really a shame that gnuplot changes the coordinates when it could use the original values adding a simple transformation in the PostScript code. I guess it's so for uniformity with other drivers. - lhf

2 Answers

4
votes

PostScript is nothing but a programming language to describe pages. A PostScript file is a plain text file containing a program that descbrise a page which gets interpreted by a printer or viewer.

As such it is amendable to programmatic manipulation, albeit in a low-level way.

I would approach this task in the following way.

  1. Learn PostScript. (The reference manual will come in handy.)
  2. Study the output from gnuplot. How does the gnuplot outputs the graph? Is this systematic? etcetera.
  3. Parse and extract the needed information.
0
votes

g3data, available here, looks like a possibility. It runs on Linux.