Account for different matrix sizes in regression and plotting