function to change graphed key