Add nan support for line plots.

This commit introduces the following changes:
- ignore nan values in Canvas.plot() and Canvas.draw_line()
- minor improvements to doc strings
- assorted small cleanups