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 comentarios

Geoff Hayes
Geoff Hayes el 29 de En. de 2016
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?
Aravindh Rajan
Aravindh Rajan el 29 de En. de 2016
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.

Iniciar sesión para comentar.

 Respuesta aceptada

Walter Roberson
Walter Roberson el 30 de En. de 2016
Editada: Walter Roberson el 30 de En. de 2016

0 votos

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 comentario

Aravindh Rajan
Aravindh Rajan el 31 de En. de 2016
Thank you for the answer, Walter. I will look into searching the axes and figure titles.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Printing and Saving en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 29 de En. de 2016

Comentada:

el 31 de En. de 2016

Community Treasure Hunt

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

Start Hunting!

Translated by