# Saving information on how plot was produced

I have some function that takes some parameters and then produces a plot which I then save somewhere on my computer. I don't want to keep the lines of input and output which produce and show the plot in the notebook, because its messy and also slows down the running of the notebook.

Does any one have any good practices for saving information on the plot, so that I could reproduce it in the future or so I could understand exactly what it shows without referring to the Mathematica file?

I'm thinking write a text file that lists the parameters used, and gives a link to the Mathematica notebook / a code snippet something like that?

Apologies for a poorly worded and very soft question.

• Why not maintain two versions: one with, and one without, the input that generated the plots? – J. M. will be back soon Oct 10 '18 at 10:19
• I'm not entirely sure I understand, but you could make an image out of a table showing the parameters and the plot, Export["bookkeekping.pdf",Column[{TableForm[parameters],plot}]] or something, with the original file name in the list of parameters and then just crop out the table when you want to use the plot for a presentation or something. – N.J.Evans Oct 10 '18 at 12:51
• You might also look at automated reports in the docs, which may be too heavy for what you want, but maybe something useful will stand out. – N.J.Evans Oct 10 '18 at 12:53
• Some tools you might use are LocalObject, Iconize, BoxFormArrangeSummaryBox, and perhaps DumpSave. You could store data and metadata in an Association. Hold[code] is useful for keeping code from executing. – Michael E2 Oct 10 '18 at 14:27

Did you know that you can hide input cells? See this:

https://reference.wolfram.com/language/workflow/HideInputInANotebook.html

More flexibly, Iconize was introduced with these type of thoughts. The cool image below is made with this simple line of code:

where blue field is hiding numerous options (as it says, 20 options):

SphericalPlot3D[1 ,{u,0,Pi},{v, 0,2Pi},
TextureCoordinateFunction->({#5,1-#4}&),
PlotStyle->Directive[Specularity[White,10],
Texture[GeoGraphics[GeoRange->"World",
GeoBackground->"ReliefMap",ImageSize->2000]]],
Lighting->{{"Ambient", White}},
Mesh->None,
Axes->False,
SphericalRegion->True,
RotationAction->"Clip",
Boxed->False,
ViewAngle->.3,
ImageSize->600]


It was made very easily with the context menu access to Iconize:

As to input cells making things slow - I doubt it is that bad, as most of them just text. Also I believe in some cases Iconize will help with that too, if it hides, for instance, some rich front-end things like images or entities.

You can also Iconize the whole input, naming it as a memo meaningfully, for example:

Iconize[
DateListPlot[{
FinancialData["IBM","Jan. 1, 2004"],
FinancialData["APPL","Jan. 1, 2004"],
FinancialData["MSFT","Jan. 1, 2004"]},
PlotTheme->"Detailed",
PlotLegends->Placed[{"IBM","APPL","MSFT"},Above]],
"IBM vs Apple vs Microsoft"]
`

which will give you a copiable object that gives plot upon evaluation: