P-Generating Polynomials and the P-Fractal of a Graph