# ParametricPlot inside of ParametricPlot [closed]

I don't know why the following is not working! The code has a function y[x] then I have g[t] then I want to plot y vs inverse of g:

Clear["Global*"]

Clear[y, g, x, t, d, b, f, m]

a = 0.7; b = 0.001; d = 0.1; f = 1.3; m = 0.7; x0 = 60;

y[x_] := x0*Sqrt[Sqrt[a - b/x^2] + d];

Plot[y[x], {x, 0, 10}]

g[t_, d_, b_, f_, m_]:=(Sqrt[a]*Log[12*Sqrt[a]*f^2*(t*Sqrt[a]+Sqrt[t^2*a-b])])/m-(ArcTanh[(t*d)/Sqrt[a*t^2-b]]*d)/m-(Log[3*f*(-b+t^2*m)]*d)/(2*m)

ParametricPlot[{{g[x, 0.1, -0.001, 1.3, 0.7], x}}, {x, 0.1, 10}]

ParametricPlot[{y[x],ParametricPlot[{g[x, 0.1, -0.001, 1.3, 0.7], x}]}, {x, 1, 10}]

• e.g., If p1 = ParametricPlot[{Sin[u], Sin[2 u]}, {u, 0, 2 Pi}] then Head[p1] is Graphics and you are trying to include this inside your plot.
– Syed
Nov 29 '21 at 17:16
• Try something like ParametricPlot[{y[x], g[x, 0.1, -0.001, 1.3, 0.7]}, {x, 1, 10}, AspectRatio -> 1] for your final line of code. Nov 29 '21 at 18:17
• I would like to see y[g^-1[t]] Nov 29 '21 at 18:34
• Please, have a look at the comment of @bbgodfrey, it is a good solution. Moreover, it does not require any inverse functions. Nov 29 '21 at 21:09
• We should plot ParametricPlot[{ g[x, 0.1, -0.001, 1.3, 0.7],y[x]}, {x, 1, 10}, AspectRatio -> 1] instead of {y[x], g[x, 0.1, -0.001, 1.3, 0.7]} Nov 30 '21 at 2:20

Not sure what you want but here is a guess:

Clear["Global*"]

Clear[y, g, x, t, d, b, f, m]

a = 0.7; b = 0.001; d = 0.1; f = 1.3; m = 0.7; x0 = 60;

y[x_] := x0*Sqrt[Sqrt[a - b/x^2] + d];

LogLinearPlot[y[x], {x, 0, 10}, PlotRange -> All]


 g[t_, d_, b_, f_,
m_] := (Sqrt[a]*Log[12*Sqrt[a]*f^2*(t*Sqrt[a] + Sqrt[t^2*a - b])])/
m - (ArcTanh[(t*d)/Sqrt[a*t^2 - b]]*d)/
m - (Log[3*f*(-b + t^2*m)]*d)/(2*m)


Calculate some values for the inverse function and then interpolate

  vals = Table[{g[x, d, b, f, m], x}, {x, 1, 10, 0.1}];
h = Interpolation[vals];
{g1, g2} = h[[1, 1]];
ParametricPlot[{h[t], y[t]}, {t, g1, g2}, PlotRange -> All,
AspectRatio -> 1,
AxesLabel -> {"y", "\!$$\*SuperscriptBox[\(g$$, $$-1$$]\)"}]


Is this now what you need?

• I want to plot y[x] vs InverseFunction [g][x] Nov 29 '21 at 18:22
• I guess it is better I say like this g[x]=t then x=g^-1[t] so now y[g^-1[t]] Nov 29 '21 at 18:37
• h[x]=InverseFunction[g][x] so how to plot parametric y vs h ?! Nov 29 '21 at 18:39
• I'm checking it. I will let you know. thanks Nov 29 '21 at 23:10

There are two ways to do this. Since we plot $$y=y(g^{-1}(x))$$ so we can use InverseFunction.

gg[x_] = g[x, 0.1, -0.001, 1.3, 0.7];
fig1=Plot[y@InverseFunction[gg][x], {x, -5, 5},AxesOrigin -> {0, 0}]


The other way is $$x=g(t)$$,then $$t=g^{-1}(x)$$,$$y(t)=y(g^{-1}(x))$$,so we plot ParametricPlot $$(g(t),y(t))$$

gg[x_] = g[x, 0.1, -0.001, 1.3, 0.7];
fig2=ParametricPlot[{gg[t], y[t]}, {t, -20, 20}, AxesOrigin -> {0, 0},
AspectRatio -> 1,PlotStyle->Red]


We can compare the two way.

Show[fig1, fig2]