matlab app designer axes buttondownfcn code example Example: matlab app designer axes buttondownfcn function lineCallback(src,~) src.Color = rand(1,3); end