The study of the relationships between plants and their environment, including soil, climate, and other organisms.