Pw <- 15; t <- 10; Pt <- Pw + t
Qd_free <- 100 - 2*Pw # 70
Qs_free <- -20 + 2*Pw # 10
Qd_tariff <- 100 - 2*Pt # 50
Qs_tariff <- -20 + 2*Pt # 30
ggplot() +
geom_segment(aes(x=0, y=50, xend=100, yend=0), color="#012169", linewidth=1.5) +
geom_segment(aes(x=0, y=10, xend=80, yend=50), color="#B9975B", linewidth=1.5) +
geom_hline(yintercept=Pw, linetype="dashed", color="darkgreen", linewidth=1) +
geom_hline(yintercept=Pt, linetype="dashed", color="red", linewidth=1.2) +
# Area A: PS gain rectangle
annotate("polygon",
x=c(Qs_free, Qs_tariff, Qs_tariff, Qs_free),
y=c(Pw, Pw, Pt, Pt),
fill="#B9975B", alpha=0.5) +
annotate("text", x=(Qs_free+Qs_tariff)/2, y=(Pw+Pt)/2, label="A\n(PS gain)",
size=3, fontface="bold") +
# Area B: DWL production triangle
annotate("polygon",
x=c(Qs_free, Qs_tariff, Qs_free),
y=c(Pw, Pw, Pt),
fill="red", alpha=0.4) +
annotate("text", x=Qs_free+2, y=Pw+3, label="B", size=3.5, fontface="bold", color="red") +
# Area C: tariff revenue rectangle
annotate("polygon",
x=c(Qs_tariff, Qd_tariff, Qd_tariff, Qs_tariff),
y=c(Pw, Pw, Pt, Pt),
fill="purple", alpha=0.3) +
annotate("text", x=(Qs_tariff+Qd_tariff)/2, y=(Pw+Pt)/2, label="C\n(Tariff\nRevenue)",
size=3, fontface="bold", color="purple") +
# Area D: DWL consumption triangle
annotate("polygon",
x=c(Qd_tariff, Qd_free, Qd_tariff),
y=c(Pt, Pw, Pw),
fill="red", alpha=0.4) +
annotate("text", x=Qd_free-3, y=Pw+3, label="D", size=3.5, fontface="bold", color="red") +
annotate("text", x=107, y=Pw, label=paste0("Pw=",Pw), size=3.2, color="darkgreen") +
annotate("text", x=107, y=Pt, label=paste0("Pt=",Pt), size=3.2, color="red") +
geom_vline(xintercept=c(Qs_free,Qs_tariff,Qd_tariff,Qd_free), linetype="dotted", alpha=0.5) +
annotate("text", x=Qs_free, y=2, label=paste0("Qs=",Qs_free), size=2.8) +
annotate("text", x=Qs_tariff, y=2, label=paste0("Qs'=",Qs_tariff), size=2.8) +
annotate("text", x=Qd_tariff, y=2, label=paste0("Qd'=",Qd_tariff), size=2.8) +
annotate("text", x=Qd_free, y=2, label=paste0("Qd=",Qd_free), size=2.8) +
annotate("text", x=102, y=0, label="D", size=4, color="#012169") +
annotate("text", x=82, y=52, label="S", size=4, color="#B9975B") +
scale_x_continuous(limits=c(0,115), breaks=seq(0,100,10)) +
scale_y_continuous(limits=c(0,55), breaks=seq(0,50,5)) +
labs(title="Effect of a Specific Tariff (t = 10)",
subtitle="CS falls by A+B+C+D; PS rises by A; Revenue = C; DWL = B+D",
x="Quantity", y="Price") +
theme_minimal(base_size=11)