I am currently plotting the heatmap of a given data. My dataset has 5 columns, (x, y, relative_frequecy, vx, vy). The fill of the heatmap is given by the relative_frequency, while vx and vy are the x- and y-components of the vector from point(x,y), respectively.
I have tried using,
plot <- ggplot(Protein_Quasipotentials, aes(x = G_Atot, y = G_Btot)) +
geom_tile(aes(fill = Relative_Frequency)) +
theme_classic() + coord_fixed() + geom_abline(slope=1, intercept=0) +
xlab("Protein A") + ylab("Protein B") +
scale_x_continuous(expand=c(0,0), limits=c(-1, 3000)) + scale_y_continuous(expand=c(0,0), limits=c(-1, 3000)) +
scale_fill_gradientn( limits=range(0,40), breaks=c(0.0, 10.0, 20.0, 30.0, 40.0), colors=c("darkorange","chocolate1", "yellow", "chartreuse2","chartreuse3")) +
theme(panel.background = element_rect(fill="cadetblue3")) +
geom_segment(aes(xend = G_Atot + vA_N, yend = G_Btot + vB_N ), arrow = arrow(length=unit(0.1, "cm")), size = 0.1)
but unfortunately, the resolution of the vector field was too high and was obscuring the data. As such, I want to cut down the data points to plot the vector field BUT NOT the relative frequency. I only see ways that will chop down relative frequency as well.