Hi everyone,
I believe I found a small graphical bug in the ndots() option when using twoway hist, recast(dot).
As per the manual "ndots(#) specifies the number of dots across a line; ndots(75) is the default."
However, ndots(0) actually shows me a single line of dots at y=0, whereas ndots(1) shows zero dots.
Here is my code, but with an example dataset (only works via editor, not directly in command window).
So, in short, I don't have a question here because ndots(1) gives me what I want (zero dots).
But given that I spent a good chunk of time I'm curious what Statalisters/Nick Cox might think of this: is this a bug or am I missing something?
Thanks
I believe I found a small graphical bug in the ndots() option when using twoway hist, recast(dot).
As per the manual "ndots(#) specifies the number of dots across a line; ndots(75) is the default."
However, ndots(0) actually shows me a single line of dots at y=0, whereas ndots(1) shows zero dots.
Here is my code, but with an example dataset (only works via editor, not directly in command window).
Code:
sysuse auto2 * I am binning length here because in my own dataset I similarly use 15 groups egen length_binned = cut(length), group(15) label * I want to convey the distribution of a binned variable, for 2 groups (note that in my own dataset I actually have 6 groups; I prefer to overlay instead of 6 side-by-side). twoway /// (hist length_binned if foreign == 0, discrete percent xlabel(0(1)14, valuelabel)) /// (hist length_binned if foreign == 1, discrete percent xlabel(0(1)14, valuelabel) fcolor(none) lcolor(blue) legend(order(1 "Domestic cars" 2 "Foreign cars"))) * but I don't like the look of bars/histogram so I recast into a dotplot * here is the graphical bug: the plot still shows dots at y=0 axis twoway /// (hist length_binned if foreign == 0, discrete percent xlabel(0(1)14, nogrid valuelabel) ylabel(, nogrid) recast(dot) ndots(0) mcolor(red) ms(Oh)) /// (hist length_binned if foreign == 1, discrete percent xlabel(0(1)14, valuelabel) recast(dot) ndots(0) mcolor(blue) ms(Th) legend(order(1 "Domestic cars" 2 "Foreign cars"))) * switching ndots(0) to ndots(1) fixes it. I don't see any dots twoway /// (hist length_binned if foreign == 0, discrete percent xlabel(0(1)14, nogrid valuelabel) ylabel(, nogrid) recast(dot) ndots(1) mcolor(red) ms(Oh)) /// (hist length_binned if foreign == 1, discrete percent xlabel(0(1)14, valuelabel) recast(dot) ndots(1) mcolor(blue) ms(Th) legend(order(1 "Domestic cars" 2 "Foreign cars")))
So, in short, I don't have a question here because ndots(1) gives me what I want (zero dots).
But given that I spent a good chunk of time I'm curious what Statalisters/Nick Cox might think of this: is this a bug or am I missing something?
Thanks
Comment