Carrots are a sort of "ground patch" so you'll want to draw the patch just above the area on the ground where you want it to grow. The amount of carrots that grow in the patch will depend on both the size of the box as well as the density set in the options.
Like all patch plants, it doesn't matter where you put it-- even if it's above solid metal or underwater, the patch will still grow!