Here is the figure:

All tutorials have an inductor in smsp-buck. But when I simulate without an inductor I see a similar plot. Why not use only a capacitor?
Here is the figure:

All tutorials have an inductor in smsp-buck. But when I simulate without an inductor I see a similar plot. Why not use only a capacitor?
A buck converter changes a high input voltage to a lower output voltage. It does it with a certain amount of grace and the result is fairly good with medium levels of ripple on the output voltage that are related to the switching frequency.
Without an inductor switch SW1 connects the input voltage to the output voltage and pushes a theoretically infinite amount of current into C1. I don't need to say anything else because to do so would be insulting.
You also ask, in a comment "Why not to use a capacitor in series instead". The buck convertor passes DC current (with some ripple) through to an output load. A capacitor in series will become charged to the line voltage and any further attempts to push DC through it will fail.
How is the current through a capacitor defined? --> Ic=C dUc/dt. What does that equation tell you? If the voltage across the capacitor changes in a short period of time (dt-->0) such as load changes or first time turning on the power supply, then Ic will be very big (a current spike). The current however cannot change in an inductor rapidly: Ul= L dIl/dt. The inductor prevents the current spike. Now when the switch is closed, a magnetic field is built by inductor. When the switch opens, there is no current flow through the inductor anymore. Magnetic field will collapse. A change in current will create a voltage spike. How do we prevent this? Since the polarity across the inductor changes, the diode will conduct providing a current path for the inductor.
The LC Combination as in the figure in question is a Low Pass filter. The inductor in addition to the capacitor is needed to filter the high frequency component of the output. Also, the inductor stores energy, so that once SW1 open up, then Inductor should store enough energy to flow a current through the diode(freewheeling). If you removed the inductor, then the diode will be reverse biased, and nothing will happen. Capacitor will just discharge to output.