Suppose an electric field $\mathbf{E}(x, y, z)$ has the form
$$E_{x}=a x, \quad E_{y}=0, \quad E_{z}=0$$
where $a$ is a constant. What is the charge density? How do you account for the fact that the field points in a particular direction, when the charge density is uniform? [This is a more subtle problem than it looks, and worthy of careful thought.]