How to dynamically assign border color using geom_node_circle?

I’m trying to change the borders of nodes in ggraph using geom_node_circle. I want to set the border colors based on a mapping between the names of the nodes and the colors that I supply for the names. I know that the parameter to change the border is colour. Make graph for example: df <-… Read More How to dynamically assign border color using geom_node_circle?

Change background color of combined plots in ggpubr::ggarrange

I can’t figure out why the bottom corners background is white, while the rest of the plot is grey. Is there anyway I can change the bottom corners color to the same background as the rest of the plot? The code im using for each plot is: HP_specifikationer_model1 <- ggplot(Svar_spec_data)+geom_hline(yintercept=0) geom_line(aes(y=HP1, x=kvartaler, color = "HP-BNP-KRE-REN"))… Read More Change background color of combined plots in ggpubr::ggarrange

Displaying percentages within category for continuous/ordered variable (with ggplot)

I have two questions, the first a (hopefully) straightforward mechanical one and the second more theoretical (though still with a technical element). I am trying to do something nearly identical to this question, but I have a variable that is ordered/continuous (0 – 4), instead of a 1/0 dichotomous variable, which means that filtering ==… Read More Displaying percentages within category for continuous/ordered variable (with ggplot)

Adding greek symbol and superscript to ggplot axis text (tickmarks)

I am trying to get the stable oxygen isotope symbol into the axis text (tick mark label) in ggplot. Example data df <- data.frame(author = c("one", "two", "three"), d18O = c("D", "D", "U"), Mg = c("I", "D", "D"), `Drip Rate` = c("U", "I", "I")) %>% pivot_longer(-c(author)) Exmample plot df %>% ggplot(aes(x = name, fill =… Read More Adding greek symbol and superscript to ggplot axis text (tickmarks)

R plotting a graph with confidence intervals

I have a dataframe that looks like this – df = data.frame(recall=c(0.55,0.62,0.43,0.61,0.19,0.14,0,0.19,0.33,0.33,0,0.33), type= c("Phone numbers","Phone numbers","Phone numbers","Phone numbers","Emails","Emails","Emails","Emails","URLs","URLs","URLs","URLs"), model=c("Cognition","TS-SAR","TS-ABINet","TS-RobustScanner", "Cognition","TS-SAR","TS-ABINet","TS-RobustScanner", "Cognition","TS-SAR","TS-ABINet","TS-RobustScanner"), lb=c(0.47,0.55,0.35,0.53, 0.07,0.04,0,0.07, 0.14,0.14,0,0.14), ub=c(0.63,0.7,0.51,0.69, 0.30,0.24,0,0.3, 0.52,0.52,0,0.52)) It consists of the results of 4 ‘text detection in image’ ML models. The recall column has the recall metric values for each model, based on the type… Read More R plotting a graph with confidence intervals

R object not found when using scale_x_discrete or scale_x_continuous

hour_mark avg_intensity <int> <dbl> 0 2.1295503 1 1.4190782 2 1.0439443 3 0.4437299 4 0.6330472 5 4.9506438 6 7.7712137 7 10.7336198 8 14.6680988 9 15.3877551 10 17.6437029 11 16.9212513 12 19.8470716 13 18.7752443 14 18.8686211 15 15.5846995 16 17.7166483 17 21.6556291 18 21.9216336 19 21.3852097 20 14.3399558 21 12.0729282 22 9.0630531 23 4.9966777 ggplot(data=avg_int_hourly, aes(x=hour_mark, y=avg_intensity,group=1))+… Read More R object not found when using scale_x_discrete or scale_x_continuous