This post is about the package catplot, contributed by Nick Cox. The help file shows an example illustrating how to graph frequencies (or optionally fractions or percents) using three categories:
Code:
sysuse auto, clear
gen himpg = mpg > 25
label def himpg 1 "mpg > 25" 0 "mpg <= 25"
label val himpg himpg
catplot himpg rep78 foreign
and this code creates the following graph: Array
Next, following the help file instructions, I reduce the gap between the second category to demonstrate how the gap is set, using the option var2opts (for the second variable rep78):
Code:
catplot himpg rep78 foreign , var2opts(gap(0))
and this code creates the following graph: Array
Clearly, the gap between the categories of rep78, with separate bars as defined by himpg, is reduced to zero.
Now I want to increase the (zero) gap of the separate bars as defined by himpg, using:
Code:
catplot himpg rep78 foreign , var1opts(gap(*.2))
and this code creates the following graph (which looks the same as the first graph without any gap control): Array
To me it looks as if var1opts(gap(*.2)), nor something like var1opts(gap(2)), is processed.
Maybe I misread the help file, or some other syntax is required, but possibly there is an error in de ado file.
In any case, it would be really useful to be able to control the gap between sub-category bars (when 3 variables are used).

This, actually, is possible with 2 variables, like:
Code:
catplot himpg rep78 , var1opts(gap(*.2)) var2opts(gap(*.5))
and this code creates the following graph: Array
But then, I am not able to change the colors of the bars between the two categories of himpg.

(Dear Nick, could you comment on my issues?)