Prints LaTex code to generate P and Q graphs for a prefix array