# Plotting a function on the different axis

I've solved the DE:

$$a\cdot x(t)+b\cdot\ln\left(1+c\cdot x(t)\right)=-p\cdot x'(t)\tag1$$

Where $$x(0)=k$$

And I got the following solution:

$$t=\int_{x(t)}^k\frac{p}{a\cdot z+b\cdot\ln\left(1+c\cdot z\right)}\space\text{d}z\tag2$$

If I want to plot the solution in mathematica I get on the y-axis the time $$t$$ but I want time at the x-axis, how can I solve that?

The code is equal to:

Plot[Integrate[(5*10^(-3))/((78/10)*
z + ((((5463/
20) + (20))*(((138064852)/(100000000))*10^(-23))*(2))/((\
(16021766208)/(10000000000))*10^(-19)))*Log[1 + ((z)/(10^(-4)))]), {z,
x, Pi}], {x, 0, 1}]


Only the axis needs to be swaped.

• try ParametricPlot?
– kglr
Commented Aug 27, 2019 at 18:22
• @kglr How can I do that? Commented Aug 27, 2019 at 18:44
• Jan, if you post the code that produced the plot you want changed, it will be easier for all to answer your question.
– kglr
Commented Aug 27, 2019 at 19:01
• @kglr I did what you asked. Commented Aug 27, 2019 at 19:11

ClearAll[int]
int[x_?NumericQ] := NIntegrate[(5*10^(-3))/((78/10)*
z + ((((5463/20) + (20))*(((138064852)/(100000000))*10^(-23))*(2))/
(((16021766208)/(10000000000))*10^(-19)))* Log[1 + ((z)/(10^(-4)))]),
{z,  x, Pi}]

plot = Plot[int[x], {x, 0, 1} ,
AspectRatio -> 1, Frame -> True, Axes -> False]


### ParametricPlot

Quiet@ParametricPlot[{int[x], x}, {x, 0, 1},
AspectRatio -> 1, Frame -> True, Axes -> False,
PlotRange -> Reverse[PlotRange[plot]]]


### Post-process

Alternatively, you can post-process plot to reverse the coordinates of Line objects:

Show[plot/. Line[x_] :> Line[Reverse /@ x], PlotRange -> All]