0

Fig1

I've made my figure(Fig1 above) and annotated it to my liking, but I want the assorted figures to be displayed in reverse alphabetical order according to the top label names. I can reverse the values of the x-axis, but "order()" and "title()" don't seem to produce the effect I'm aiming for here. Is there any way to tell R I want the multi plot ordered differently? Or, is this just something I'll have to edit myself in another program like Adobe? Code might be sloppy, but I'm just starting to work in R.

library(tidypaleo) data<-read.table('multiplot_r.txt',sep="\t",header=TRUE) as_tibble(data) zone_data <- tibble(ymin = 0, ymax = 9649, xmin = -Inf, xmax = Inf) multi_plot + geom_rect(mapping = aes(ymin = ymin, ymax = ymax, xmin = xmin, xmax = xmax), data = zone_data, alpha = 0.2, inherit.aes = FALSE) multi_plot <- ggplot(data, aes(x = value, y = Age)) + geom_lineh() + scale_y_reverse() + facet_geochem_gridh(vars(param)) + geom_hline(yintercept = c(2200,2800,5000,5500), linetype = "dashed", colour = "red")+ labs(x = "d18O", y = "Years BP") multi_plot 
1
  • 1
    Try with converting your param variable to a factor and setting the order of the levels in your desired order. Commented Aug 2, 2021 at 17:47

1 Answer 1

0

Set param as a factor and reverse the order.

library (tidyverse) data <- data %>% mutate(param = fct_rev(param)) 
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.