Companion planting can be defined as the close planting of different species based on their ability to enhance one another's growth or offer some form of pest protection or other advantages. Sometimes this is a matter of choosing plants with different growth habits that don't compete with one another, or it can mean choosing companions that have different nutrient needs in order to make efficient use of soil. Strategic companion planting is especially important in small gardens or wherever careful space planning is needed.
Cucumbers are a rather exuberant crop, with vines that can sprawl over a lot of space—the more healthy the cucumber plant, the more space they seem to take up. But space requirements aside, cucumbers can also "play well" with more types of vegetables than you might first think. For example, because cucumbers typically hug the ground, towering or climbing vegetables and flowers such as corn or sunflowers will stand well above the blanket of cucumber vines. These plants also don't require much in the way of water, and so they won't compete with cucumbers for moisture.
There are many vegetables that make excellent companions for cucumbers. Peas, corn, and beans are legumes—a type of plant that as a root system that increases nitrogen in the soil. The mechanism by which this happens is that roots have the ability to colonize the Rhizobrium bacteria and absorb about 20 percent of the sugar produced by the plant—which is then turned into nitrogen. Any of the nitrogen not absorbed by the legume then is released into the nearby soil as the plant decomposes, thereby becoming available to nearby companion plants.
This will benefit your cucumber plants, as well as many other garden plants. Marigold flowers will help repel beetles, and nasturtiums are distasteful to thrips and other insects that feed on cucumbers. (These flowers make for good companions for almost all vegetables and herbs.) Oregano is an herb with a well-establish reputation for repelling insect pests and is another good companion for cucumbers.
Poor Companions for Cucumbers
Just as some plants are good companions together, there are also those that shouldn't be allowed to reside side-by-side. Potatoes compete mightily with cucumbers for nutrients and water, so they should not be planted with cucumbers. (For some reason, other members of the nightshade family, such as tomatoes, do not have this effect on cucumbers.) Sage seems to attract pests that feast on cucumber leaves, and thus should be avoided. In general, other ground-hugging vining crops are likely to compete with cucumbers, and therefore should not be planted in the same vicinity as cucumbers.
Cucumbers grow poorly when planted near: