NE might expect that Jonah would have learned his lesson in the belly of the whale. But, reading chapter 4 reveals to us that he didn't. Well, he learned something, but he still had more to learn. He learned to obey God, but he still had to learn to think the way God thinks.
Actually, Jonah chapter 4 should never have been written. The Book of Jonah would be complete without chapter 4. Jonah could have stayed in Nineveh and been the pastor of the largest group of believers in the world at that time. What a missionary! But he didn't. After just 1 day of preaching to the Ninevites (Jonah 3:4), Jonah headed out of town. In fact, as the city turned to God, Jonah's face turned red with rage (Jonah 4:1). He awaited death; either his own or of the Ninevites. He didn’t seem to care which.
Now, the people of Nineveh did receive mercy from God. And, this WAS actually the result that Jonah expected. It was not the result that he desired though. While he only preached for a day, he sat and watched the city for at least 39 days (afterward) in hopes of seeing a great demonstration of God's wrath upon it (Jonah 3:4 & 4:5). He wanted the Assyrians to die and go to hell. He hated them.
So, God prepared a little test and lesson for Jonah's edification. Just like God had prepared a storm, a whale and a stomachache earlier on (Jonah 1:4, 17 & 2:10), at this point He prepared a shade to cool Jonah off and to ease his grief (Jonah 4:6). It worked. Jonah was happy. But God was setting him up. The next day God sent a worm to kill the plant (Jonah 4:7). Then, God sent a hot wind to torment him and to reveal the shallow bitterness of his heart (Jonah 4:8). That worked rather well also. Jonah got angry again.
Twice in this chapter God asked Jonah if he had a good reason to be angry (Jonah 4:4 & 9). Jonah thought he did, but God disagreed. God compared the dead plant to the living population of Nineveh & reprimanded Jonah soundly (Jonah 4:11). Surely Jonah's look in the mirror must have been deeply convicting (if he realized that he was guilty of wanting a single gourd to live while wishing for hundreds of thousands of people to die). What strange priorities!