function [] = patchClickTest()
  figure(2);
  %patch([0 0 1 1], [0 1 1 0], 'r', 'ButtonDownFcn', @leftPatch);
  %patch([1 1 2 2], [0 1 1 0], 'g', 'ButtonDownFcn', @rightPatch);
  patch([0 0 1 1], [0 1 1 0], 'r', 'ButtonDownFcn', @patchPressed, 'Tag', 'left', 'UserData', 0);
  patch([1 1 2 2], [0 1 1 0], 'g', 'ButtonDownFcn', @patchPressed, 'Tag', 'right', 'UserData', 1);
  
    function out = leftPatch(source, eventdata, handles)
        disp('left patch was pressed');
    end

    function out = rightPatch(source, eventdata, handles)
        disp('right patch was pressed');
    end

    function out = patchPressed(source, eventdata, handles)
        patchTag = get(source, 'Tag');
        userData = get(source, 'UserData');
        fprintf('%s patch at index %d was pressed\n', patchTag, userData);
    end
end