Re: st: AW: Gap between lines in dot plot

 From Friedrich Huebler To statalist@hsphsun2.harvard.edu Subject Re: st: AW: Gap between lines in dot plot Date Tue, 3 Nov 2009 23:30:29 -0500

```Thank you, Vince. With your example I can indeed get the effect I had
been looking for.

. graph dot mpg turn, over(rep78) outergap(150)

Friedrich

On Tue, Nov 3, 2009 at 1:22 PM, Vince Wiggins, StataCorp
<vwiggins@stata.com> wrote:
>
>> How can the lines in a dot plot with over() be moved closer
>> together?  The gap() option has no effect.
>>
>> . sysuse auto
>> . graph dot mpg turn, over(rep78) name(dot1)
>> . graph dot mpg turn, over(rep78, gap(*.5)) name(dot2)
>>
>> I expected the lines in the second graph to be closer together but
>> both graphs look the same.
>
> I have found that illustrating this question is way beyond my
> abilities as an ASCII artist.  So, if you are interested, I
> suggest you open Stata and then draw the graphs that follow.
>
> Friedrich is right, there is no difference in these two graphs.
>
>    . sysuse auto
>    . graph dot mpg turn, over(rep78)
>    . graph dot mpg turn, over(rep78, gap(*.5))
>                                      ^^^^^^^^
>
> This is subtle and technical, but what it comes down to is that
> there are no "gaps" in the first graph.  There is just an axis
> with the values of -rep78- evenly spaced.
>
> This graph, however does have a gap,
>
>    . graph dot mpg turn, over(rep78) over(foreign)
>
> The gap is not between the values of rep78.  Those are, again,
> just evenly spaced values on an axis.  The two rep78 axes
> (determined by the two values of foreign) do, however, have a
> gap between them.  So,
>
>    . graph dot mpg turn, over(rep78) over(foreign, gap(*.1))
>                                                    ^^^^^^^^
>
> does have an effect.
>
> In Friedrich's original graph, the axis wants to take up all of
> the space on the graph.  If Friedrich want to scrunch the lines
> together in the middle, he can specify an outer gap, e.g.,
>
>    . graph dot mpg turn, over(rep78) outergap(150)
>
> I have asked Friedrich privately if this is the effect he seeks.
>
> I am hoping that this question relates to a graph for
> Friedrich's blog.  If you are interested in some effective use
> of graphics, and in particular Stata graphics, take a look at,
>
>     http://huebler.blogspot.com/
>
> Which is not to imply that the content isn't interesting too.
>
>
> -- Vince
>   vwiggins@stata.com

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/
```