How is the Maxwell-Boltzmann curve obtained?
There is, indeed, a function that plots the graph.

There are two common types of graph, one with kinetic energy as the $x$-axis, and one with speed. For the most part, they are qualitatively the same, although there is a slight difference in curvature near the origin. The speed function is much more commonly used, because one can more easily extract useful information from it, such as mean velocities, or mean free paths. It is:

$$f(v) = (4\pi v^2) \cdot \left(\frac{m}{2\pi kT}\right)^{3/2} \cdot \exp{\left(-\frac{mv^2}{2kT}\right)}$$

where $m$ refers to the mass of the particle, $k$ Boltzmann's constant, and $T$ the temperature.

As for the derivation, it is rather long and perhaps you were not really asking for it. If you are interested, I would recommend looking it up in a physical chemistry textbook, for example: Atkins' Physical Chemistry, 10th ed., section 1B(b), or Levine's Physical Chemistry, 6th ed., section 14.4. I am partial towards Levine because he gives a much more detailed explanation than Atkins, who is always very brief.