1520s, "of or pertaining to grammar," from Middle French grammatical and directly from Late Latin grammaticalis "of a scholar," from grammaticus "pertaining to grammar" (see grammar). Related: Grammatically (c. 1400).
"Of the nature of an ideogram or ideograph; using symbols as a means of expression", Late 19th cent.; earliest use found in Science. From ideogram + -atic.