Dear Statalisters,
Why is it that xlabel(#) fails to produce the expected result when date appears on the x-axis?
Consider the minimal example:
clear
use http://www.stata-press.com/data/r13/sp500
scatter high low // by default, 6 labels on x-axis
scatter high low, xlabel(#4) // after customization, 4 label on x-axis
line open date // by default 5 label on x-axis, with "2002" on the right-hand side appearing outside the bounds of the plot and being cutoff
line open date, xlabel(#4) // same result as without the xlabel option
I tried "tsset date", prior to the "line" command, but it did not help.
Suggestion to fix this basic problem would be appreciated. I would prefer a solution that does not require custom entry of dates in xlabel every time I want to make a simple plot like the one above.
Thank you!
Why is it that xlabel(#) fails to produce the expected result when date appears on the x-axis?
Consider the minimal example:
clear
use http://www.stata-press.com/data/r13/sp500
scatter high low // by default, 6 labels on x-axis
scatter high low, xlabel(#4) // after customization, 4 label on x-axis
line open date // by default 5 label on x-axis, with "2002" on the right-hand side appearing outside the bounds of the plot and being cutoff
line open date, xlabel(#4) // same result as without the xlabel option
I tried "tsset date", prior to the "line" command, but it did not help.
Suggestion to fix this basic problem would be appreciated. I would prefer a solution that does not require custom entry of dates in xlabel every time I want to make a simple plot like the one above.
Thank you!
Comment