Suppose I want to graph some data and I want to set a specific range on the x-axis, like so:
sysuse auto, clear
scatter mpg price, xlabel(3000[1000]16000)
Stata seems to be interpreting this command to mean that I want roughly those limits and leaves a bit of extra space on the left and the right of those numbers. Is there any way to get rid of this extra space and to make graph cut off exactly at these numbers?
Normally I would direct you to the options xscale() and yscale(), but in your example what you are seeing is nothing to do with that. By default Stata adds a bit of space around the plotregion but you can remove it with the extra option
plotregion(margin(zero))
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With