I want to make a simple plot representing a consumer's consumer surplus in Stata. By default, Stata leaves some blank margin in the left, but this makes the graph quite strange (the triangle is not closed).I searched Statalist and tried many ways to remove it, including using xscale and plotregion(margin(zero)), but none of them worked. Could anyone tell me how to achieve this (removing the blank between AB and the y axis in the attached graph)? Many thanks in advance.
The code I wrote is as follows:
clear
The code I wrote is as follows:
clear
Code:
set obs 100 generate q=_n-1 generate p=50 generate cons=100-q twoway (line cons q) (line p q, lpattern(dash)), xline(25, lpattern(dash)) xtitle("Consumption") ytitle("Price") text(51 51 "O", place(nw)) text(50 1 "A", place(s)) text(100 1 "B", place(n)) xlabel(25 "Garbage") ylabel(50 "p" 100 "a") title("Free Disposal of Garbage") xscale(range(0 105)) legend(off) graphregion(margin(zero))
Comment