import numpy and remove warnings that do not appear with matplotlib 1.2.1

Fix a possible NameError if numpy is not imported and remove two warnings that do not appear using matplotlib 1.2.1.