# I want to plot g1 and g2 in the same PlotRange

I want to plot g1 and g2 in the same PlotRange. I wrote the following code. But it doesn't work. Please help me.

plotArealElement[r_, phi_, dr_, dphi_] := Module[
{g1, g2, x, y, u, v, plr},
g1 = ParametricPlot[s {Cos[phi], Sin[phi]}, {s, r, r + dr}, {psi, phi, phi +
dphi}];
u = r {Cos[phi], Sin[phi]};
v = r {Cos[phi + dphi], Sin[phi + dphi]};
x = v - u;
v = (r + dr) {Cos[phi], Sin[phi]};
y = v - u;
plr = Options[g1, PlotRange];
g2 = ParametricPlot[s x + t y, {s, 0, 1}, {t, 0, 1}, plr[[1]]];
Show[g1, g2]
]

• (1) Change g1 = ParametricPlot[s {Cos[phi], Sin[phi]}, ...] to g1 = ParametricPlot[s {Cos[psi], Sin[psi]}, ...] and (2) Change plr[[1]] in the line g2 = ... to Evaluate@plr[[1]] – kglr Jun 7 '18 at 23:25
• ... or remove plr[[1]] from the line g2 =... – kglr Jun 7 '18 at 23:51
• Thank you very much, kglr – tchappy ha Jun 7 '18 at 23:52

1. Fix a typo in definition of g1:
g1 = ParametricPlot[s {Cos[psi], Sin[psi]}, {s, r, r + dr}, {psi, phi, phi + dphi}]

1. Either remove plr[[1]] in the line defining g2 or change it to Evaluate@plr[[1]]. Note that in both cases Show gets its PlotRange (actually all its unspecified options) from g1 so PlotRange in g2 (whether it is Evaluate @ plr[[1]] or PlotRange-> anything) does not affect the output of Show.
With these changes, plotArealElement works as expected. For example,
plotArealElement[.2, Pi, .1, 2 Pi/3]

plotArealElement[.2, Pi, .1, 3 Pi/2]