library(tidyverse)
library(data.table)
library(ggpubr)
library(tikzDevice)
options(scipen = 10)
csv1 <- fread("to_parity.csv")
p1 <- ggscatter(csv1, x="out_states_to_parity_old", y="out_states_to_parity_all", color="filename") +
scale_x_log10() + scale_y_log10() + geom_abline(slope=1) + theme(legend.position = c(0.01, 1), legend.spacing.x = unit(0, 'mm'), legend.justification=c("left", "top"),
legend.box.just="right", legend.margin=margin(0, 0, 0, 0), axis.text.y = element_text(angle = 90, hjust=.5),
legend.title=element_blank(), legend.box.background=element_rect(color="black", size=1)) +
labs(x="unoptimized CAR (states)", y="new paritization (states)")
p1 <- p1 + font("caption", size = 9) + font("xylab", size = 9) + font("xy.text", size = 9)
p1
tikz("plot.tex", sanitize=TRUE, standAlone=TRUE, width=2.5, height=2)
p1
dev.off()
p2 <- ggscatter(csv1, x="out_states_to_parity_no_degen", y="out_states_to_parity_all", color="filename") +
scale_x_log10() + scale_y_log10() + geom_abline(slope=1) + theme(legend.position = c(0.01, 1), legend.spacing.x = unit(0, 'mm'), legend.justification=c("left", "top"),
legend.box.just="right", legend.margin=margin(0, 0, 0, 0), axis.text.y = element_text(angle = 90, hjust=.5),
legend.title=element_blank(), legend.box.background=element_rect(color="black", size=1)) +
labs(x="new paritization without partial-degen (states)", y="new paritization (states)")
p2 <- p2 + font("caption", size = 9) + font("xylab", size = 9) + font("xy.text", size = 9)
p2
tikz("plot2.tex", sanitize=TRUE, standAlone=TRUE, width=3, height=3)
p2
dev.off()