Drawing line in notebook with Mathematica command

I have a for loop that makes plots iteratively, in between the plots, I would like to draw a line in the notebook. Is there a command that is the equivalent of doing this:

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

• Any other method to divide my notebook up would be appreciated as well – reemodels Sep 20 at 13:12
• Why not use GraphicsColumn and Table instead of For (and Print, I guess?)? – xzczd Sep 20 at 13:31

There's many ways to achieve something like this, but a start for programmatically creating a line to go across your notebook would be something like this:

CellPrint[
Cell["", "Text", Editable -> False, Selectable -> False,
CellFrame -> {{0, 0}, {0, 0.5}}, ShowCellBracket -> False,
CellMargins -> {{0, 0}, {1, 1}},
CellElementSpacings -> {"CellMinHeight" -> 1},
CellFrameMargins -> 0, CellFrameColor -> RGBColor[0, 0, 1],
CellSize -> {Inherited, 3}]] Of course the options can be edited, if you want it thicker, a different color, etc...

Hope this helps!

An alternative approach is to print the cells with graphics contents with a line at the bottom:

ClearAll[thickLineBelow]
thickLineBelow = CellPrint[ExpressionCell[#, "Output", CellFrame -> {{0, 0}, {3, 0}},
CellFrameColor -> RGBColor[0, 0, 1]]] &;

You can wrap each graphics object you produce in the loop with thickLineBelow:

thickLineBelow /@ {Plot[Sin[x], {x, 0, 2 Pi}, AspectRatio -> 1/4],
Row[Framed /@ {Graphics[{Red, Disk[]}, ImageSize -> 100],
Plot[x Sin[x], {x, 0, 5 Pi}, ImageSize -> 200]}, Spacer],
MatrixPlot[RandomReal[1, {5, 30}], ImageSize -> 300]}; 