baisc graph func