# Transposing X and Y on a plot [duplicate]

This question has appeared in many forms online, but none directly apply to my problem. I have a quite complicated, albeit bijective function of the form

F: X->Y.


Concretely, here is the function of two variables, which I named "Graham":

Graham[d_, σ_] :=
Module[{β, ϵ0, h, m, e0, ϕ0},
h = 6.62606957*10^(-34);
ϵ0 = 8.8541878176*10^(-12);
m = 9.10938291*10^(-31);
e0 = 1.6*10^(-19);

β = 4/(((5*((3/5 2^(-1/3) (3/π)^(
2/3))*((ϵ0*
h^2)/(m*(e0)^(5/3)))*(d^(-5/3)*σ^(-1/3)))/
3)*(1/2)^(2/3))^(3/4)*Sqrt[5]);

ϕ0 = (Cosh[β/2])/(β*Sinh[β/2]) -
1/(β*Sinh[β/2]);

Return[ϕ0]]


A relevant plot of this function would be

Plot[{Graham[10^-9, σ]}, {σ, 0, 1}]


I want to reflect this function over the x=y line. I know how to do it point-wise and using listline plot and the transformation

rt = ReflectionTransform[{1, -1}];

rt[{x, y}]
{y, x}


but I'm sure there must exist a way to somehow reflect it around the identity x=y. Help is much appreciated!

• – kglr May 28 '15 at 13:38

Here are a couple of approaches:

1. using ParametricPlot

Quiet@ParametricPlot[{Graham[10^-9, t], t}, {t, 0, 1},
AspectRatio -> Full]

2. Let p be your plot and just extract points:

ListPlot[Reverse /@ First[Cases[p, Line[x__] :> x, -1]],
Joined -> True]


• Thank you for your fast reply, it totally works! – drabus May 28 '15 at 13:10