plot nodes function