Hi everyone,
I have created an illisible chart, in which the various graphics are superimposed and you can't really read them.
How could I "zoom in" (for example: the x scale from 0 to 500,000, to see the density curves better).
I've tried -xscale- but it doesn't seem to work.
Also, I have another question: Is it possible to automate the label values to avoid the annoying manual way I use, where I type everything.
Below is the code I used and the resulting graph. The code is inspired by the fantastic blog created by Fahad Mirza "Top 25 Stata Visualizations — With Full Code" on Medium.

Thanks in advance for your help.
Best,
Michael
I have created an illisible chart, in which the various graphics are superimposed and you can't really read them.
How could I "zoom in" (for example: the x scale from 0 to 500,000, to see the density curves better).
I've tried -xscale- but it doesn't seem to work.
Also, I have another question: Is it possible to automate the label values to avoid the annoying manual way I use, where I type everything.
Below is the code I used and the resulting graph. The code is inspired by the fantastic blog created by Fahad Mirza "Top 25 Stata Visualizations — With Full Code" on Medium.
Code:
encode(tariff_ekon_id), gen(tariff_ekon_id_) levelsof tariff_ekon_id_, local(tariff_type1) foreach typeof_tariff of local tariff_type1 { quietly summarize power_p1 local kden_t "`kden_t' (kdensity power_p1 if tariff_ekon_id_ == `typeof_tariff', range(`r(min)' `r(max)') recast(area) fcolor(%50) lwidth(*0.25))" } twoway `kden_t', scheme(white_tableau) /// legend(subtitle("Contract Types:", size(2)) label(1 "20A") label(2 "20DHA") label(3 "20DHS") label(4 "20TD") label(5 "21A") label(6 "21DHA") label(7 "21DHS") label(8 "30") /// label(9 "30TD") label(10 "31") label(11 "61A") label(12 "61TD") label(13 "62TD") label(14 "63TD") label(15 "64TD") rowgap(0.25) size(2)) /// title("{bf}Density Plot", pos(11) size(2.75)) /// ytitle("Density", size(2) orient(horizontal)) /// ylabel(, nogrid labsize(2)) /// xlabel(0(50000)900000, labsize(tiny) alternate nogrid format(%9.0fc)) /// xtitle("Contracted Powers", size(2)) /// subtitle("Tariff Types, 1{sup:st} Period", pos(11) size(2)) graph export "../figures/distr_tariff_types_kdens.png", replace graph export "../figures/distr_tariff_types_kdens.pdf", replace
Thanks in advance for your help.
Best,
Michael
Comment