1
$\begingroup$

Is there a way to quickly print all of the plots (and nothing else) in a notebook?

$\endgroup$
3
  • 2
    $\begingroup$ I asked AI and it said to select all cells with GraphicsBox. Once selected, you can map over each cell and print it or export. This is what AI said to try. outputCells = Cells[CellStyle -> "Output"]; cellsWithGraphics = Select[outputCells, ! FreeQ[NotebookRead[#], GraphicsBox] &]; MapIndexed[ Export[ToString[#2[[1]]] <> ".png", #1] &, cellsWithGraphics ] Never tried it. But you can try it yourself and see. Change the Export command above to Print if that is what you want. Note, AI sometimes gives buggy or invalid code. $\endgroup$ Commented Jul 15 at 16:44
  • $\begingroup$ Just saw what looks like duplicate question how-to-export-all-graphics-from-a-notebook , just change the Export to Print if needed. My guess also is that gogle AI just used the answer above in its answer. $\endgroup$ Commented Jul 16 at 4:48
  • 1
    $\begingroup$ Following up on @Nasser's comment, I'm voting to close as a duplicate as the solution of just extracting the cells with Graphics objects to print is the correct one and may easily be extended to include the surrounding section cells $\endgroup$ Commented Aug 15 at 19:40

1 Answer 1

0
$\begingroup$

A quick and easy way would be to select all output cells with Option-click (on Mac) and then "Print Selection..." from the File menu. That's assuming that output cells only contain plots.

$\endgroup$

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.