I am trying to make a ggplot2 with a colour bar with two scales (or two sets of labels) on both sides of the colour bar (for example having both a cm and inches scale on the left and right side of colour guide bar or having Celsius AND Fahrenheit). Is something like that possible in ggplot2? See picture for what I am looking for (ideally, in this small example I would have the numbers 1:5 at the bottom of the bar and the letters a:e on the top of the bar). Could I make two legends and just overlay them somehow? also having a title on the top and bottom would be helpful
df <- tibble(A = letters[1:5], B = 1:5)
ggplot(df, aes(x = A, y = B, fill = B)) +
geom_col() +
scale_fill_gradient(high = "blue", low = "red",
labels = letters[1:5],
guide = guide_colorbar(
direction = "horizontal",
title.position = 'top',
title.hjust = 0.5,
label.hjust = 0.5,
legend.location = "bottom",
label.position = "top")
) +
theme(legend.position = "bottom")
