can we change the look of histogram to slash background, like the below?
-
Login or Register
- Log in with
clear all
version 16
sysuse auto
table foreign, c(mean price)
input id x y
1 0.7 0
1 0.7 6072.4
1 1.3 6072.4
1 1.3 0
1 0.7 0
2 1.7 0
2 1.7 6384.7
2 2.3 6384.7
2 2.3 0
2 1.7 0
end
graph bar price, over(foreign) name(g1)
twoway area y x, xlabel(1 "Domestic" 2 "Foreign") ///
xscale(range(0.5,2.7)) xtitle("") ///
ytitle("mean of price") name(g2)
twoway parea y x, pattern(pattern4) ///
xlabel(1 "Domestic" 2 "Foreign") ///
xscale(range(0.5,2.7)) xtitle("") ///
ytitle("mean of price") name(g3)
graph combine g1 g2 g3, rows(1)
clear input str1 which whatever A 78 B 89 C 68 D 77 end local opts ytitle(whatever) ysc(titlegap(*5) r(. 100)) set scheme s1color graph hbar (asis) whatever, over(which) `opts' name(G1, replace) blabel(total) yla(none, nogrid) bar(1, bfc(none)) graph hbar (asis) whatever, over(which, sort(1)) `opts' name(G2, replace) blabel(total) yla(none, nogrid) bar(1, bfc(none)) local lineopts linetype(line) lines(lc(gs12) lw(thin)) graph dot (asis) whatever, over(which) `opts' `lineopts' name(G3, replace) blabel(total) local opts ytitle(whatever) ysc(r(60 100)) su whatever, meanonly graph dot (asis) whatever, over(which, sort(1)) `opts' `lineopts' yla(`r(min)' `r(max)') exclude0 name(G4, replace) blabel(total) graph combine G1 G2 G3 G4
Comment