Do electromagnetic waves occupy varying amounts of space, or do they simply vary in magnitude?

The above diagram shows an electromagnetic wave propogating in the $x$ direction, if the electric field is in the $y$ direction and the magnetic in the $z$ direction.

I was taught however that the strength of an electric field is given by the 'density' of field lines in a region, and in the above graphic it seems that the density is always the same, but that the area the electric field occupies changes. This implies that the strength of the electric field along the x axis never really changes, but it just spreads into the y axis.

But then I thought perhaps it is not the space that the electric field occupies that changes, but the magnitude of the electric field, with this being the only way to show it graphically. So is an electromagnetic field just a single beam on the x axis with varying magnitudes of E and B, or does it extend into the y and z directions?