Is there a simple way to reverse axis on a plot (all --- Plot
and LogPlot
and LogLogPlot
). I found this but it deals with ListPlot
. Also I tried ScalingFunctions
but they make put the origin wrongly. Also it does not seem to work for logarithmic plots.
What I want is the same plot but x-axis starting from λL
and ending in λH
with the origin on the left hand side of the plot. Also I am not sure if some tick rewriting will work as suggested in some other solutions as I really need to start from the left with the plot not just the ticks.
h = QuantityMagnitude[UnitConvert[Quantity[1, "PlanckConstant"], "SIBase"]];
c = QuantityMagnitude[UnitConvert[Quantity[1, "SpeedOfLight"], "SIBase"]];
kB = QuantityMagnitude[UnitConvert[Quantity[1, "BoltzmannConstant"], "SIBase"]];
TSun = 5800;(* Kelvins *)
TEarth = 255;(* Kelvins *)
Bλ[T_, λ_] := (2 h*c^2)/λ^5 1/(Exp[h/(kB*T) c/λ] - 1);
λL = 1*10^-9;(* "Meters" *)
λH = 100*10^-6;(* "Meters" *)
Plot[{Bλ[TSun, λ], 10^6*Bλ[TEarth, λ]}, {λ, λH, λL},
PlotLegends -> {
"\!\(\*SubscriptBox[\(T\), \(Sun\)]\) = 5800 K",
"\!\(\*SubscriptBox[\(T\), \(Earth\)]\) = 255 K"},
PlotRange -> All
]