I want to prepend graphics (as generated by Plot
) to an existing .nb notebook file, each new addition being placed as a new cell at the top of the notebook page. But I cannot figure out how to do it. Yes I know the function PutAppend
, but this function has some problems:
- the added graphics are not shown as graphics in the notebook, but as input code;
- it puts the new content at the end of the file, not at the beginning;
- the newly added part does not exist as a separate cell.
So PutAppend
may not fit here. How then can it be done?
__
Edit: I hope to do it without opening the notebook file in question and to save the file automatically after adding graphics.
NotebookImport
. InsertCell[BoxData@ToBoxes@yourPlot, "Input"]
and the first position.Export
thatNotebook
. $\endgroup$ – b3m2a1 Feb 13 '18 at 4:39