How to make legend order match with plot

Match legend order with plot data order with fct_reorder2

In this post we will learn how to make a line plot such that data on the plot matches with the legend order. We will use forcats package’s fct_reorder2() function. Let us load the packages needed. We will use gapminder data set to make a line plot. First let us compute average life expectancy per… Continue reading How to make legend order match with plot

Exit mobile version