set pattern from pgm