The surface-mediated synthesis of ordered linear or zigzag polymers on a highly oriented pyrolytic graphite surface was investigated either at a solid/liquid interface or with moderate heating under low vacuum. Scanning tunneling microscopy (STM) reveals the submolecular details of the structure and growth dynamics of surface-confined one-dimensional polymers. We discovered that the substituent and concentration of monomers have a significant effect on the assembling structure of the in-situ-synthesized one-dimensional polymer at the octanoic acid/graphite interface.