global program "EEREV-D-21-00004_Figure2"

cap log close
cap log using "$log\log_$program$today", replace

**** REPLICATION OF FIGURE 2 ****

clear all
set mem 2g
set more off

/*	
	OUTLINE
	1. DRAW GRAPH
*/

*************************
***** 1. DRAW GRAPH *****
*************************

// Import candidate data

use $data\EEREV-D-21-00004_Data_Candidates.dta, clear

// All candidates

twoway 	(scatter tru_C neg_C if radright==0 & annee<=1974, mlabel(cand_year) mlabsize(tiny) msize(small) mlabpos(12) mcolor(navy*.5) mlabcolor(navy*.5)) ///
		(scatter tru_C neg_C if radright==1 & annee<=1974, mlabel(cand_year) mlabsize(tiny) msize(small) mlabpos(12) mcolor(navy*.5) mlabcolor(navy*.5) msymbol(D)) ///
		(scatter tru_C neg_C if radright==0 & annee>=1995, mlabel(cand_year) mlabsize(tiny) msize(small) mlabpos(12) mcolor(navy) mlabcolor(navy)) ///
		(scatter tru_C neg_C if radright==1 & annee>=1995, mlabel(cand_year) mlabsize(tiny) msize(small) mlabpos(12) mcolor(navy) mlabcolor(navy) msymbol(D)) ///
		(lfit tru_C neg_C, range(-.04 .54) lcolor(maroon) lpattern(dash)) ///
		, title("All candidates", ring(0)) xtitle("Candidate radicalism (CMP)") ytitle("Voter distrust (FES, log scale)") ///
		xlabel(0 "0" .1(.1).5, format(%5.1f)) ylabel(0 "1" 1.6094379 "5" 3.2188758 "25" 4.8283137 "125", format(%5.0f) angle(0)) xscale(r(-.05 .55)) yscale(r(-.5 5.5)) ///
		legend(off) /// 
		graphregion(color(white)) name(all, replace)

// Maor candidates		

twoway 	(scatter tru_C neg_C if poll>.1 & radright==0 & annee<=1981, mlabel(cand_year) mlabsize(tiny) msize(small) mlabpos(12) mcolor(navy*.5) mlabcolor(navy*.5)) ///
		(scatter tru_C neg_C if poll>.1 & radright==1 & annee<=1981, mlabel(cand_year) mlabsize(tiny) msize(small) mlabpos(12) mcolor(navy*.5) mlabcolor(navy*.5) msymbol(D)) ///
		(scatter tru_C neg_C if poll>.1 & radright==0 & annee>1981, mlabel(cand_year) mlabsize(tiny) msize(small) mlabpos(12) mcolor(navy) mlabcolor(navy)) ///
		(scatter tru_C neg_C if poll>.1 & radright==1 & annee>1981, mlabel(cand_year) mlabsize(tiny) msize(small) mlabpos(12) mcolor(navy) mlabcolor(navy) msymbol(D)) ///
		(lfit tru_C neg_C if poll>.1, range(-.04 .54) lcolor(maroon) lpattern(dash)) ///
		, title("Major candidates (above 10% in polls)", ring(0)) xtitle("Candidate radicalism (CMP)") ytitle("Voter distrust (FES, log scale)") ///
		xlabel(0 "0" .1(.1).5, format(%5.1f)) ylabel(0 "1" 1.6094379 "5" 3.2188758 "25" 4.8283137 "125", format(%5.0f) angle(0)) xscale(r(-.05 .55)) yscale(r(-.5 5.5)) ///
		legend(lab(1 "Before 1974") lab(3 "After 1995") lab(4 "Radical right") order(1 3 4) pos(4) region(col(white)) ring(0) c(1) symx(*0.5) size(vsmall)) ///
		graphregion(color(white)) name(major, replace)
		
graph combine all major /// 
	, c(2) graphregion(color(white)) imargin(vsmall) ///
 	b1title("") l1title("", size(vsmall)) 
	
graph export "$results\\$program.png", replace width(7200) height(3000)

cap log close
