0
$\begingroup$

This follows on my previous question that was kindly solved by a fellow member.

data = Reverse[Sort[RandomReal[1, 5]]];
Module[{t = 0, len = Length[data], sum = Total[data]}, 
 Graphics[Table[{Hue[i/len], EdgeForm[Opacity[.8]], 
    Disk[{0, 0}, 1, {t, t += 2 Pi data[[i]]/sum}]}, {i, len}]]]

SelectionMove[EvaluationNotebook[], Next, Cell]
SetOptions[NotebookSelection[EvaluationNotebook[]], Background -> Red,
  Alignment -> Center]
$\endgroup$

1 Answer 1

1
$\begingroup$

Alignment is not an option for Cell:

Options[Cell Alignment]

enter image description here

Use TextAlignment instead:

SelectionMove[EvaluationNotebook[], Next, CellGroup]
SetOptions[NotebookSelection[EvaluationNotebook[]], Background -> Red,
  TextAlignment -> Center]

enter image description here

enter image description here

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.