Virtues work the same way, but in reverse. They improve everyone they touch. It's as good for someone with shaky morals to spend time with better people as it is for a sick person to live somewhere warm and healthy. You can see how powerful this is if you watch how wild animals become tame when they live with us. No matter how fierce an animal is, it won't stay wild if it gets used to being around humans for long enough. All that savageness gets softened. In peaceful surroundings, it's gradually forgotten.
Virtues do the same thing in the opposite direction, and improve all those with whom they are brought in contact: it is as good for one of unsettled principles to associate with better men than himself as for an invalid to live in a warm country with a healthy climate. You will understand how much may be effected this way, if you observe how even wild beasts grow tame by dwelling among us, and how no animal, however ferocious, continues to be wild, if it has long been accustomed to human companionship: all its savageness becomes softened, and amid peaceful scenes is gradually forgotten.