How to set the output be generated in a cell different from "Output"

It is possible to change the style used for output with this Front End option:

"GeneratedCellStyles" -> {"Output" -> (* style *)}

One can change this style as part of the output formatting routine using $PrePrint, like this:

defaultOut[] := SetOptions[EvaluationNotebook[],
  "GeneratedCellStyles" -> {"Output" -> "Output"}]

altOut[] := SetOptions[EvaluationNotebook[],
  "GeneratedCellStyles" -> {"Output" -> "altOutput"}]

output[gr_Graphics] := (altOut[]; gr)
output[other_] := (defaultOut[]; other)

$PrePrint = output;

Now (bare) Graphics objects will be output with a Cell style of "altOutput" rather than "Output" yet other expressions will be handled normally. One could extend output to handle an arbitrary number of heads as needed. (Graphics is merely an example here.)


If you want to do it all programmatically you could import the notebook containing the cells with graphics and change the cell style for cells containing graphics:

changeStyle[file_String, newStyle_String] := 
  Module[{nb = NotebookOpen[file], nb1},
   nb1 = NotebookGet[nb];
   NotebookClose[nb];
   nb = nb1 /. (p1 : Cell[BoxData[GraphicsBox[_, ___]], "Output", ___] :> (p1 /. 
         "Output" -> newStyle) );
   NotebookSave[nb, file];
   ];

changeStyle["/pathTo/Untitled.nb", "Text"]

To address @MichaelE2 concerns:

changeStyle[file_String, newStyle_String] := 
  Module[{nb = NotebookOpen[file], nb1, newfile},
   nb1 = NotebookGet[nb];
   NotebookClose[nb];
   nb = nb1 /. (p1 : 
        Cell[BoxData[GraphicsBox[_, ___]], "Output", ___] :> (p1 /. 
         "Output" -> newStyle));
   newfile = 
    SystemDialogInput[
     "FileSave", {NotebookDirectory[], {"New File \"*.nb\"" -> {"*.nb"}}}, WindowTitle -> "Saved New Notebook"];
   If[newfile =!= $Canceled && newfile =!= $Failed,
    NotebookSave[nb, newfile]
    ]
   ];

For Graphics output specifically there is a nice approach using $DisplayFunction:

(* create a new output style -- overwrites existing custom style sheet *)
SetOptions[EvaluationNotebook[],
 StyleDefinitions -> 
  Notebook[{Cell[StyleData[StyleDefinitions -> "Default.nb"]], 
    Cell[StyleData["altOutput"], TextAlignment -> Center]}, 
   StyleDefinitions -> "PrivateStylesheetFormatting.nb"]
 ]

(* define a display function *)
altOutput[expr_] := CellPrint @ ExpressionCell[expr, "altOutput"]

$DisplayFunction = altOutput;

Graphics output in this Notebook will now be centered. You could also set the DisplayFunction option for individual plot types independently rather than using the global $DisplayFunction parameter.