there are 3 degrees of freedom in translational movement, 1 degree in vibration and the last is in rotation
Actually there are 3 translational, 2 rotational, and 1 vibrational degree of freedom for a two-atomic molecule.
The vibrational one is not shown in this picture, although it's easy to see what it is (atoms oscillating along the molecular bond with a phase difference of $\pi$, i.e. in antiphase, for more information see this).
Now for the question: It's true that the molecule can rotate in an infinite number of directions, but (think about it) it can also move translationally in an infinite number of directions as well. The key point is that all the translation (rotation) can be written as a superposition of the basic three (two for rotation) movement directions. So, in a way, any rotation of the molecule you may perceive is actually a combined, simultaneous rotation around both possible axes.