Fixed an issue where a local variable overwrote a matplotlib one.