As with many things related to cats, there is no single foolproof way to keep cats--yours or a neighbor's--out of your flower bed. But there are plenty of ways to try. If the garden design calls for it, you might want to try a physical barrier, such as a fence. But there are also more hidden ways to control kitty visits.
Dump citrus peels--orange, grapefruit, lemon or lime--into your garden. The scent should keep cats from exploring. You'll need to replace the peels as they dry out and lose their scent.
Fill small glass jars, such as baby food jars, with diluted ammonia and bury near the perimeter of your garden. The smell should keep cats at bay, and putting the ammonia in glass jars will keep the liquid from leeching into the soil.
Spread coffee grounds or used tea leaves throughout your garden. The grounds or tea leaves should be evenly spread and they will also help with fertilization. But the scent will keep cats away.
Mix up black pepper, red pepper and dry mustard in equal parts and spread on the perimeter of your garden. The smell--and the taste when the cat gets it paw into the mixture and then licks it off--will discourage the cat.
Fill old, clear, plastic juice containers with water and place throughout your garden. In theory, the reflection from the water will keep cats away.
Install an ultrasonic noise machine near your garden. These devices emit a sound that only animals can hear and not only will cats be deterred, but other visitors should be, as well.
Put a motion detector on your garden sprinkler. This will have the same effect as spraying a cat with a water bottle to keep him or her off furniture.
Right after planting seeds, cover the garden with a garden netting or lightweight landscape fabric. The seedlings will be able to push up through fabric and you can cut the fabric as plants get larger. Cats should be deterred because they cannot dig through the fabric.