add graphical function