0
$\begingroup$

I'm trying to plot two functions. In general, this is not a difficult task, thanks e.g. to the command:

Plot[{Sin[x], Cos[x]}, {x, 0, 2 Pi}, PlotLabels -> "Expressions"]

However, I would like to plot two functions, one of them with respect to variable $x$ of the plane, and another with respect to the variable $y$. For example $y=\ln x$ and $x=y^2$.

Someone knows what should I do?

$\endgroup$
3
$\begingroup$

You can use ContourPlot, but then you have to supply the $y$-range:

ContourPlot[{y==Log[x], x == y^2}, {x, -2, 2}, {y, -2, 2}, Axes->True, Frame->False]

enter image description here

| improve this answer | |
$\endgroup$
2
$\begingroup$

Both kinds of plots can be thought of as parametric plots, where for the first one $x$ is the independent parameter and for the second one $y$ is the independent parameter. With ParametricPlot take a parameter $t$ that is used in both roles:

f[x_] = Log[x];
g[y_] = y^2;
ParametricPlot[{{t, f[t]}, {g[t], t}}, {t, -1, 1}, 
  AspectRatio -> 1/GoldenRatio]

enter image description here

| improve this answer | |
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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