Yahweh God prepared a vine, and made it to come up over Jonah, that it might be a shade over his head, to deliver him from his discomfort. So Jonah was exceedingly glad because of the vine.
The supernatural appearance of this "gourd" overnight is one of no less than six lesser wonders that surround, confirm, and support the far greater wonder of Jonah's deliverance from death.  (See full discussion of this under Jonah, the Great Old Testament Type, at the end of the commentary on Jonah.)