extract legend from a plot

get_legend(plot)

Arguments

plot

a gg or gtable object

Value

a 'gtable' object of the legend

Author

Guangchuang Yu