using mktemp for graph