Your x and t spans are not convenient. Try this
f = 0.5;
tau = 1/f;
c = 3*10^8;
lambda = c/f;
phi = 0;
K = 2*pi/lambda;
omega = 2*pi*f;
E_0 = 1;
t = linspace(0,tau*3,1000);
x = linspace(0,lambda*3,1000);
[T,X] = meshgrid(t,x);
E = E_0*sin(K*X-omega*T);
surf(T,X,E,'EdgeColor','interp')
xlabel('Time axis')
ylabel('x axis')