Fixed matplotlib plotting issues