modified plot trigger, code so that it works with new R version

more or less copied the process from trigger imputes

some changes to the trigger .each calls, to make them .eachSeries,
because otherwise couchdb crashes and burns.