Hello,
ListPlot[Sqrt[A[n]^2 + B[n]^2] /. n -> {1, 2, 3, 4, 5, 6, 7, 8},
PlotRange -> {{0*\[Pi], 2*\[Pi]}, Automatic}, Filling -> Axis]

How the x-axis looks now is like when 1 would be pi, 2 would be 2pi, 3 would be 3pi, etc:

ListPlot[Sqrt[A[n]^2 + B[n]^2] /. n -> {1, 2, 3, 4, 5, 6, 7, 8},
PlotRange -> {{0*\[Pi], 3*\[Pi]}, Automatic}, Filling -> Axis,
Ticks -> {{0*\[Pi], 1*\[Pi], 2*\[Pi], 3*\[Pi]}, Automatic}]

How can I make the x-axis look like this? Is it possible?

Mathematica 13.2 Notebook file attached.
Thank you.
Entire code:
f5[x_] := \!\(\*
TagBox[GridBox[{
{"\[Piecewise]", GridBox[{
{"1",
RowBox[{"0", "<", "x", "<", "1"}]},
{"0",
RowBox[{"1", "<", "x", "<", "2"}]}
},
AllowedDimensions->{2, Automatic},
Editable->True,
GridBoxAlignment->{"Columns" -> {{Left}}, "Rows" -> {{Baseline}}},
GridBoxItemSize->{"Columns" -> {{Automatic}}, "Rows" -> {{1.}}},
GridBoxSpacings->{"Columns" -> {
Offset[0.27999999999999997`], {
Offset[0.84]},
Offset[0.27999999999999997`]}, "Rows" -> {
Offset[0.2], {
Offset[0.4]},
Offset[0.2]}},
Selectable->True]}
},
GridBoxAlignment->{"Columns" -> {{Left}}, "Rows" -> {{Baseline}}},
GridBoxItemSize->{"Columns" -> {{Automatic}}, "Rows" -> {{1.}}},
GridBoxSpacings->{"Columns" -> {
Offset[0.27999999999999997`], {
Offset[0.35]},
Offset[0.27999999999999997`]}, "Rows" -> {
Offset[0.2], {
Offset[0.4]},
Offset[0.2]}}],
"Piecewise",
DeleteWithContents->True,
Editable->False,
SelectWithContents->True,
Selectable->False,
StripWrapperBoxes->True]\)
Plot[f5[x], {x, 0, 2.5}, Exclusions -> None];
T = 2 - 0;
A0 = 2/T*\!\(
\*SubsuperscriptBox[\(\[Integral]\), \(-
\*FractionBox[\(T\), \(2\)]\),
FractionBox[\(T\), \(2\)]]\(f5[x] \[DifferentialD]x\)\) // Simplify;
A[n_] = 2/T*\!\(
\*SubsuperscriptBox[\(\[Integral]\), \(-
\*FractionBox[\(T\), \(2\)]\),
FractionBox[\(T\), \(2\)]]\(f5[x]*Cos[
\*FractionBox[\(2*\[Pi]*n*x\), \(T\)]] \[DifferentialD]x\)\) //
Simplify;
B[n_] = 2/T*\!\(
\*SubsuperscriptBox[\(\[Integral]\), \(-
\*FractionBox[\(T\), \(2\)]\),
FractionBox[\(T\), \(2\)]]\(f5[x]*Sin[
\*FractionBox[\(2*\[Pi]*n*x\), \(T\)]] \[DifferentialD]x\)\) //
Simplify;
s5[k_, x_] := A0/2 + \!\(
\*UnderoverscriptBox[\(\[Sum]\), \(n = 1\), \(k\)]\((A[n]*Cos[
\*FractionBox[\(2*\[Pi]*n*x\), \(T\)]] + B[n]*Sin[
\*FractionBox[\(2*\[Pi]*n*x\), \(T\)]])\)\) // Simplify;
ListPlot[Sqrt[A[n]^2 + B[n]^2] /. n -> {1, 2, 3, 4, 5, 6, 7, 8},
PlotRange -> {{0*\[Pi], 3*\[Pi]}, Automatic}, Filling -> Axis,
Ticks -> {{0*\[Pi], 1*\[Pi], 2*\[Pi], 3*\[Pi]}, Automatic}]
Attachments: