rudimentary error checking in plotting