# Sine Wave Graph Custom X Axis and Y Axis

I have the next code:

Plot[{Sin[x],
Piecewise[{{Sin[x + Pi], 0 <= x <= Pi/4}, {Sin[x + Pi],
Pi <= x <= 5*Pi/4}, {Sin[x + Pi], 2*Pi <= x <= 9*Pi/4}}, _],
Piecewise[{{Sin[x], Pi/4 <= x <= Pi}, {Sin[x],
5*Pi/4 <= x <= 2*Pi}, {Sin[x], 9*Pi/4 <= x <= 3*Pi}}, _]}, {x, 0,
3 Pi}, Filling -> {2 -> Axis, 3 -> Axis},
FillingStyle -> {2 -> Directive[Opacity[0.5], Blue],
3 -> Directive[Opacity[0.5], Red]},
PlotStyle -> {Dashed, Blue, Red},
Ticks -> {Range[0, 3*Pi, Pi/2], Automatic},
PlotLegends -> {"AC Voltage Supply", "Gate Voltage",
"Output Voltage"}]


The Output is the next graph: Is it possible to do the same graph but instead of displaying on the X Axis: π/2, π, 3 π/2, 2π to display T/4, T/2, 3/4 T, T ? .. T is for Period

and in the Y Axis, instead of 1, to display Vmax?

xt = Range[0, 3 Pi, Pi/2];
xticks = Transpose[{xt, xt /. Pi -> T/2}];
yticks = {{-1, "vMin"}, {-1/2, ""}, {1/2, ""}, {1, "vMax"}};


You can use the option

Ticks -> {xticks, yticks}


in your plot = Plot[Sin[x],, ...] or as

Show[plot, Ticks -> {xticks, yticks}] • good, but I think it has to be: xticks = Transpose[{xt, xt /. Pi -> T/2}]; Dec 31 '19 at 22:59
• @DieDauphin, right. Fixed now.
– kglr
Dec 31 '19 at 23:11