added subplots and multiple figure support