I want to align a histogram and boxplot after combining them in a single graph.
The code below reproduces what i want, however the alignment is artificial after "manipulating" the left label of the histogram [ylabel(,labgap(-5) tposition(inside))] and the margin of the combined graph [imargin(b=0 l+5 t=0)].
i would like to align the x axis of both graphs without "manually" introducing adhoc values.
#delimit ;
use https://rodrigotaborda.com/ad/data/e...02510_old.dta;
histogram icfes
,
title("")
ytitle("")
xtitle("")
xsca(alt)
percent
xscale(range(280 570))
xlabel(300(50)550)
yscale(range(0 20))
ylabel(5(5)18)
ylabel(,labgap(-5) tposition(inside))
name(hist_icfes, replace)
;
graph hbox icfes
,
ytitle("")
fysize(25)
yscale(range(280 570))
ylabel(300(50)550)
name(box_icfes, replace)
;
graph combine
hist_icfes
box_icfes
,
title(ICFES)
cols(1)
imargin(b=0 l+5 t=0)
note(Nota: Histograma muestra el porcentaje.)
;
graph drop
hist_icfes
box_icfes
;
The code below reproduces what i want, however the alignment is artificial after "manipulating" the left label of the histogram [ylabel(,labgap(-5) tposition(inside))] and the margin of the combined graph [imargin(b=0 l+5 t=0)].
i would like to align the x axis of both graphs without "manually" introducing adhoc values.
#delimit ;
use https://rodrigotaborda.com/ad/data/e...02510_old.dta;
histogram icfes
,
title("")
ytitle("")
xtitle("")
xsca(alt)
percent
xscale(range(280 570))
xlabel(300(50)550)
yscale(range(0 20))
ylabel(5(5)18)
ylabel(,labgap(-5) tposition(inside))
name(hist_icfes, replace)
;
graph hbox icfes
,
ytitle("")
fysize(25)
yscale(range(280 570))
ylabel(300(50)550)
name(box_icfes, replace)
;
graph combine
hist_icfes
box_icfes
,
title(ICFES)
cols(1)
imargin(b=0 l+5 t=0)
note(Nota: Histograma muestra el porcentaje.)
;
graph drop
hist_icfes
box_icfes
;
Comment