Refactored plotting code to use key based indexing

This allows Grids to display missing values correctly and
ensures that frames are not out of sync