Tracing script files from figures

Hi! I have a whole lot of script files and figures. What I want to do is find the script file that generated a particular figure. Is there a way I can do this?
Thanks in advance.

2 Commenti

Aravindh - perhaps tag each figure name with a unique script identifier so that you can relate the two. Or are you trying to match the two after the fact?
Yes, I am. Unfortunately, I simply acquired a mass of figures and scripts. I am making an assumption that the person who worked on it saved the figures using the script itself. Is there a way I can find the script in this case.
I'm pretty sure I cannot do this if the person generated the figure and saved it manually afterwards.

Accedi per commentare.

 Risposta accettata

Walter Roberson
Walter Roberson il 30 Gen 2016
Modificato: Walter Roberson il 30 Gen 2016

0 voti

Unfortunately, no, when savefig() is done, the name of the calling function or script is not recorded.
(Exception: .fig files saved by GUIDE itself have the filename buried in them in the ApplicationData property GUIDEOptions structure. On the other hand those .fig are always named the same thing as the corresponding .m except with the different extension, so this is of little use, and is irrelevant to your situation anyhow.)
If you have an example figure for each script, you can (automatically) compare the properties of the example figure against each target figure to determine the plausibility that the script was used. This would be easiest in the case where the script did not have multiple options about figures to produce. For example, it is possible to programmatically search .fig files looking for the title() field of axes, since different scripts tend to title .fig differently.
I am assuming here that when you say "figure" that you are referring to a .fig file, not to an image file. Image files are more difficult to analyze by program.

1 Commento

Thank you for the answer, Walter. I will look into searching the axes and figure titles.

Accedi per commentare.

Più risposte (0)

Categorie

Scopri di più su Printing and Saving in Centro assistenza e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by