Correct data import and plotting function