The way in which these two texts can be compared is through the theme of transformation. Both of the central characters undergo a profound transformation that causes them to change considerably from how they are presented at the beginning of the play. Macbeth, for example, is shown to be a character who is naturally cautious about committing an evil deed, and somebody that will not commit a crime as grevious as regicide without persuasion from his wife, who is shown to be bloodthirsty and without any moral compunctions at the beginning of the play. However, as the play develops, they, curiously, swap roles, as Macbeth becomes more and more assertive in planning murder by himself without his wife's persuasion and encouragement, and Lady Macbeth becomes more and more haunted by her involvement in Duncan's death. Note how in Act II scene 2 Macbeth talks about the murder of Banquo and Fleance to his wife:
Be innocent of the knowledge, dearest chuck,
Till thou applaud the deed.
Macbeth deliberately keeps his plan for their deaths from his wife, only wanting her to hear about the fact of their deaths, whereas with Duncan, she had to plan the murder and be involved herself.
In the same way, Eliza Doolittle starts off at the beginning of Pygmalion as a cockney flower girl but ends up convincing everybody around her that she is a well-to-do lady who had always lived that way. She transforms utterly, but her transformation is used to comment on the subjective nature of transformation, as Eliza reflects:
You see, really and truly, apart from the things anyone can pick up (the dressing and the proper way of speaking, and so on), the difference between a lady and a flower girl is not how she behaves, but how she's treated.
Transformation therefore is only important and successful depending on how somebody is treated. In the eyes of Higgins, Eliza will always be a flower girl, because he treats her like one. Pickering, on the other hand, treats her like a lady, and thus she is a lady to him. Both texts therefore explore the theme of transformation of character, though in slightly different ways.