fix up plotting.py and js examples

This also fixes a bug introduced by patches hit testing