Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

RE: st: Odd behavior of -graph hbar- with value labels containing apostrophes


From   "daniel waxman" <dan@amplecat.com>
To   <statalist@hsphsun2.harvard.edu>
Subject   RE: st: Odd behavior of -graph hbar- with value labels containing apostrophes
Date   Tue, 4 Sep 2007 01:12:18 -0400

The workaround does the job.
Thanks for the remarkably quick reply!

Dan


-----Original Message-----
From: owner-statalist@hsphsun2.harvard.edu
[mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Vince Wiggins,
StataCorp
Sent: Tuesday, September 04, 2007 12:15 AM
To: statalist@hsphsun2.harvard.edu
Subject: Re: st: Odd behavior of -graph hbar- with value labels containing
apostrophes

Dan Waxman <dan@amplecat.com> writes, 

> I am trying to make bar graphs over categorical variables, with
> value labels, e.g.:
>
> .  graph hbar(mean) satisfied, over(q12)
>
> In this situation, the value labels extend off the edge of the y
> axis, such that only a couple of letters appear.
>
> . label list q12
> q12:
>            1 definitely true
>            2 somewhat true
>            3 no strong opinion
>            4 somewhat untrue
>            5 definitely untrue
>            6 don't know/refused
>
> If I do the following:
>
> .  label define q12 6 "do not know/refuse", modify
> .  graph hbar(mean) satisfied, over(q12)
>
> Then it looks as it should.
> [...]


The left quote in "don't ..." is causing problems when the length of the
label
is computed, and this leads to leaving too little room for the graph's right
axis.  

I am hopeful that this can be fixed in the next ado update, but if not it
will
be fixed in the one after that.

It's not pretty, and it takes some trial and error, but in the interim Dan
can
work around this by adding some space "by hand" using the option
-graphregion(margin(l=25))-.  I am just guessing at the "25"; Dan will need
to
play with that number until things look right.

 
-- Vince 
   vwiggins@stata.com


*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index