Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
st: Re: Misaligned labels in dot chart
From
Friedrich Huebler <[email protected]>
To
[email protected]
Subject
st: Re: Misaligned labels in dot chart
Date
Tue, 3 Dec 2013 12:20:39 -0500
There was no response from the list and therefore I contacted Stata
tech support. The problem appears to be caused by a bug in the
-nofill- option. The solution proposed by Stata tech support is to
create and combine separate graphs.
sysuse auto
replace foreign = 1 if rep78==1 | rep78==4
graph dot (mean) mpg if foreign==0, over(make, label(labsize(tiny)) ///
sort(mpg)) over(rep78) nofill title(Domestic) saving(v1, replace)
graph dot (mean) mpg if foreign==1, over(make, label(labsize(tiny)) ///
sort(mpg)) over(rep78) nofill title(Foreign) saving(v2, replace)
graph combine v1.gph v2.gph
Friedrich
On Fri, Nov 29, 2013 at 1:00 PM, Friedrich Huebler <[email protected]> wrote:
> I use Stata 12.1 and encountered a problem with misaligned labels in a
> dot chart. The problem can be demonstrated with the example below.
>
> . sysuse auto
> . graph dot mpg, over(make, label(labsize(tiny)) sort(mpg))
> over(rep78) by(foreign) nofill name(v1)
> . replace foreign = 1 if rep78==1 | rep78==4
> . graph dot mpg, over(make, label(labsize(tiny)) sort(mpg))
> over(rep78) by(foreign) nofill name(v2)
>
> In the second graph, some of the labels are not aligned with the lines
> that they represent, for example "Cad. Eldorado" on the top left and
> "Pont. Firebird" on the top right. The problem appears to be related
> to the gaps in rep78 (between 3 and 5 on the left side and between 1
> and 3 on the right side) because without such gaps all labels are
> properly aligned (see first graph).
>
> How can I create a graph with properly aligned labels?
>
> Thanks,
>
> Friedrich
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/faqs/resources/statalist-faq/
* http://www.ats.ucla.edu/stat/stata/