The picture by Sagan is somewhat of a simplification of the true geometry - so in a sense that picture is a metaphor. The interpretation given there of Einstein's equations is indeed that of curvature of 4 dimensional Space-Time (not just 3 dimensional space).
However in these higher dimensional geometries there is more than one notion of curvature: Scalar Curvature R; Ricci curvature; Riemann Curvature and Weyl Curvature. The Scalar curvature exists in all dimensions and is simply a function giving the curvature at each point. For an embedded (2-dim) sphere it is R$=2/r^2$ (twice the Gaussian curvature). So for a sphere it is non-zero everywhere on its surface. Higher dimensional spaces use these other Curvature objects (built like generalised matrices and called Tensors) to represent their curvature more precisely than a single number. In higher dimensions the Scalar represents a kind of "average curvature" (at each point).
Corresponding to these different notions of curvature, there are different notions of "flatness" as we will see below.
Now the Einstein equations directly equate the Ricci curvature to something; and in the example shown in the Sagan excerpt it was equated to zero. Ricci$ = 0$ is the Einstein Vacuum equation alluded to in other answers, and is appropriate because outside a star there is a vacuum. This has an immediate mathematical consequence that R$=0$ ie the scalar is zero as well! So in this sense the vacuum is flat (called Ricci-flat).
However there is still curvature around in that space, so it is not Minkowski (ie Euclidean) flat. The experimental demonstration of this was the bending of light rays near the Sun (assuming as one does in Einstein's theory that light rays measure the "straight lines"). So where does the curvature come from if it is Scalar and Ricci flat? The answer is that it is not Riemann flat: the tensor Riemann$\neq 0$. However this does not quite explain the origin of curvature here. Expressed very loosely we have the following equation:
Weyl = Riemann - Ricci - R
So the real source of curvature in the Sagan excerpt is the Weyl component of the Riemann tensor: everything else is zero. Now we come to the representation problem that Sagan had: the Weyl tensor is always zero in two and three dimensions. In other words the kind of curvature it represents does not exist in two and three dimensions: only four and above dimensions have this kind of curvature. So it cannot be directly represented on a 2 or 3 dimensional picture.
Instead what Sagan appears to have represented here is the gravitational potential (like in Newton's theory) but expressed as space curvature. It is not completely wrong perhaps, but it is not quite correct and so is just a metaphor.
This post imported from StackExchange Physics at 2014-04-09 16:16 (UCT), posted by SE-user Roy Simpson