Now that Mathematica has already embedded Wolfram Alpha, so I'd like to plot a graph: "Air Density" - "Elevation".

I know that




But I can't do that 10000 times. Is there any convenient way to do that? Such as Range[0,10000]?


1 Answer 1


One can just use StandardAtmosphereData[] instead:

ρ = Table[QuantityMagnitude[StandardAtmosphereData[Quantity[h, "Meters"], "Density"]],
          {h, 0, 10^4, 10}];

ListLinePlot[ρ, Axes -> None, Frame -> True,
             FrameLabel -> {"Height (m)", "Density (kg/m³"}]

density vs. height plot for air


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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