plot array starting or ending with nan

I need to plot some arrays that may begin or end with

    > nan's. Currently, mpl does a good job handling something
    > like plot([1,2,nan,4]), but the has trouble with
    > plot([nan,2,3,4]) and plot([1,2,3,nan]).

    > Could somebody point me in the right direction: where can
    > I look in the sourcecode to learn how mpl deals with
    > plotting nans?

mpl doesn't explicitly do anything with nan . I think what you are
observing has something to do with how agg is handling these values,
because they are passed straight through to the backend.

So, for now, there is no place in the mpl code to go, though I would
like to add some support for nan, or masked arrays, or masks, in the