Achieving control over the self-organization of functional molecules on graphene is critical for the development of graphene technology in organic electronic and spintronic. Here, by using a scanning tunneling microscope (STM), we show that the electron acceptor molecule 7,7', 8,8'-tetracyano-p-quinodimethane (TCNQ) and its fluorinated derivative 2,3,5,6-tetrafluoro-7,7', 8,8'-tetracyano-p-quinodimethane (F4-TCNQ), co-deposited on the surface of epitaxial graphene on Ru(0001), transform spontaneously into their corresponding magnetic anions and self-organize in two remarkably different structures. TCNQ forms densely packed linear magnetic arrays, while F4-TCNQ molecules remain as isolated non interacting magnets. With the help of density functional theory (DFT) calculations, we trace back the origin of this behavior in the competition between the intermolecular repulsion experienced by the individual charged anions, which tends to separate the molecules, and the delocalization of the electrons transferred from the surface to the molecules, which promotes the formation of molecular oligomers. Our results demonstrate that it is possible to control the spatial arrangement of organic magnetic anions co-adsorbed on a surface by means of chemical substitution, paving the way for the design of two-dimensional fully organic magnetic structures on graphene and on other surfaces.