It is generally a bad idea to combine to different types of data in the same plot. If you are going to do it, it is best if they are visually distinct. So, here is one approach to get what you want.
First, some sample data:
temp_data <-
tibble(
A = paste0("x", 1:5)
, B = paste0("x", 1:5)
) %>%
complete(A, B) %>%
mutate(interaction = runif(n(), 0, 10)
, Other = runif(n(), 0, 100))
Then, the plot, note that I am using two different geometries and filtering to only display the one I want for each (you could also do this from completely separate data frames if, for example, your secondary measure was stored somewhere else).
ggplot() +
geom_raster(
aes(x = A
, y = B
, fill = interaction)
, temp_data %>%
filter(A != B)
) +
geom_point(
aes(x = A
, y = B
, color = Other)
, temp_data %>%
filter(A == B)
, size = 5
) +
scale_fill_distiller(palette = "Blues") +
scale_color_distiller(palette = "Reds")
Results in:
