Specifying plot order with ggsubplot

前端 未结 2 1763
滥情空心
滥情空心 2021-01-03 16:27

I\'m adding bar-plots to maps using ggplot and ggsubplot, but cannot figure out how to specify which to plot first. I\'d like to plot the northerly ones first so they sit b

2条回答
  •  萌比男神i
    2021-01-03 16:57

    The underlying map was pretty much of a mess in the resulting figure, but this pre-ordering seemed to bring the high latitude items to the front:

    world_map = world_map[order(world_map$lat),]
    

    It wasn't clear whether you wanted the negative latitudes to be plotted under the latitudes nearer the Equator, so you also have the option of using abs(world_map$lat) as the order.

提交回复
热议问题