Density parameter as a function of scale factor (cosmology) I'm trying to recreate the following plot of the density parameters $\Omega_i$ as a function of the scale factor: 
(Taken from here)
which uses current values for $\Omega_{R0}=5\times10^{-5}$, $\Omega_{M0} = 0.3$, and $\Omega_{\Lambda0}=0.7$.
I know the scale factor is defined as $$\Omega_i = \frac{8\pi G}{3H^2}\rho_i.$$ From the Friedman equation, we also have $$\Omega_R + \Omega_M + \Omega_\Lambda = 1$$ which is clear from the plot. 
However, I'm still confused as to where the $a$ dependence is coming from. I know part of it comes from writing the densities as power laws: $$\rho_i \sim a^{-n}$$ where $n=0,3,$ or $4$ for $\Lambda, M$ and $R$ respectively. But clearly this is not enough to reproduce the plot. I thought then maybe it is from the $H=\dot{a}/a$ but if I just want to vary $a$ what would happen with the $\dot{a}$. 
It seems I'm missing something. Should I not be trying to derive $\Omega_i(a)$ from the definition of $\Omega$? It seems like there should be some sort of differential equation I should be able to solve to get $\Omega_i(a)$ using $\Omega_i(1)=\Omega_{i0}$ as an initial condition. 
Sorry if this is asking too much but I am just extremely confused.
 A: Using the Friedmann equation (in terms of $H$) and the respective scale-factor dependence of energy densities ($\rho_i$, where $i = M, R, \Lambda$), we can obtain the scale-factor dependence of density parameters as follows:
$$
\begin{align*}
\Omega_M(a) &= \frac{8\pi G}{3 (H(a))^2}\left(\rho_M(a)\right)^{-3} \\
            &= \frac{8\pi G}{3 H_0^2}\frac{\rho_{M0}a^{-3}}{(\Omega_{\Lambda0} + (1 - \Omega_{\Lambda0} - \Omega_{M0} - \Omega_{R0})a^{-2} + \Omega_{M0}a^{-3} + \Omega_{R0}a^{-4})} \\
\implies\Omega_M(a) &= \frac{\Omega_{M0}a^{-3}}{\Omega_{\Lambda0} + (1 - \Omega_{\Lambda0} - \Omega_{M0} - \Omega_{R0})a^{-2} + \Omega_{M0}a^{-3} + \Omega_{R0}a^{-4}}
\end{align*}
$$
$$
\begin{align*}
\Omega_R(a) &= \frac{8\pi G}{3 (H(a))^2}\left(\rho_R(a)\right)^{-4} \\
            &= \frac{8\pi G}{3 H_0^2}\frac{\rho_{R0}a^{-4}}{(\Omega_{\Lambda0} + (1 - \Omega_{\Lambda0} - \Omega_{M0} - \Omega_{R0})a^{-2} + \Omega_{M0}a^{-3} + \Omega_{R0}a^{-4})} \\
\implies\Omega_R(a) &= \frac{\Omega_{R0}a^{-4}}{\Omega_{\Lambda0} + (1 - \Omega_{\Lambda0} - \Omega_{M0} - \Omega_{R0})a^{-2} + \Omega_{M0}a^{-3} + \Omega_{R0}a^{-4}}
\end{align*}
$$
$$
\begin{align*}
\Omega_\Lambda(a) &= \frac{\Lambda}{3 (H(a))^2} \\
            &= \frac{\Lambda}{3 H_0^2}\frac{1}{(\Omega_{\Lambda0} + (1 - \Omega_{\Lambda0} - \Omega_{M0} - \Omega_{R0})a^{-2} + \Omega_{M0}a^{-3} + \Omega_{R0}a^{-4})} \\
\implies\Omega_\Lambda(a) &= \frac{\Omega_{\Lambda0}}{\Omega_{\Lambda0} + (1 - \Omega_{\Lambda0} - \Omega_{M0} - \Omega_{R0})a^{-2} + \Omega_{M0}a^{-3} + \Omega_{R0}a^{-4}}
\end{align*}
$$
Using these expressions and the given current values of density parameters: $(\Omega_{R0},\,\Omega_{M0},\,\Omega_{\Lambda0}) \equiv (5\times10^{-5},\,0.3,\,0.7)$, we can plot these functions in Mathematica to arrive at the following semi-log graph:

The code for the plot is given below:
oR0 = 5*10^-5; oM0 = 0.3; oL0 = 0.7;

oR[a_] := (oR0 a^-4)/(
  oL0 + (1 - oM0 - oL0 - oR0) a^-2 + oM0 a^-3 + oR0 a^-4);

oM[a_] := (oM0 a^-3)/(
  oL0 + (1 - oM0 - oL0 - oR0) a^-2 + oM0 a^-3 + oR0 a^-4);

oL[a_] := oL0/(oL0 + (1 - oM0 - oL0 - oR0) a^-2 + oM0 a^-3 + oR0 a^-4);

oRPlot = LogLinearPlot[oR[a], {a, 10^-30, 10^10}, PlotRange -> All, 
   PlotStyle -> Magenta];
oMPlot = LogLinearPlot[oM[a], {a, 10^-30, 10^10}, PlotRange -> All, 
   PlotStyle -> Blue];
oLPlot = LogLinearPlot[oL[a], {a, 10^-30, 10^10}, PlotRange -> All, 
   PlotStyle -> Orange];

plot = Show[oMPlot, oLPlot, oRPlot, Frame -> True, GridLines -> {{0}, {1}}, 
 AxesStyle -> Opacity[1], 
 FrameLabel -> {{"\!\(\*SubscriptBox[\(\[CapitalOmega]\), \
\(i\)]\)(a)", None}, {"a", None}}, ImageSize -> Large];
Legended[plot, 
 LineLegend[{Magenta, Blue, 
   Orange}, {"\!\(\*SubscriptBox[\(\[CapitalOmega]\), \(R\)]\)", 
   "\!\(\*SubscriptBox[\(\[CapitalOmega]\), \(M\)]\)", 
   "\!\(\*SubscriptBox[\(\[CapitalOmega]\), \
\(\[CapitalLambda]\)]\)"}]]

A: You can use the Fluid equation. 
$$\dot{\rho_i}+3H\rho_i(1+w)=0$$
divide by $\rho_{c}$
$$\frac{\dot{\rho_i}}{\rho_{c}}+3H\frac{\rho_i}{\rho_{c}}(1+w)=0$$
$$\dot{\Omega_i}+3H\Omega_i(1+w)=0$$
And if you solve it you'll get 
$$\Omega_i = \Omega_{i,0}a^{-3(1+w)}$$
