Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: RE: RE: CATPLOT and "ytitle" option

From   Nick Cox <>
Subject   Re: st: RE: RE: CATPLOT and "ytitle" option
Date   Thu, 3 Feb 2011 01:26:22 +0000

Thanks to David for answering Lucie's question and to both for
positive comments.

For your information, the default -ytitle()- that -catplot- supplies
in this instance is "percent". My reasoning behind that was that the y
axis shows ... percents (not the response variable). An accessible
example is

. sysuse auto
. catplot rep78, by(foreign) percent(foreign)

An alternative design is

. catplot rep78 foreign, percent(foreign)

Note that -catplot- makes no use of -title()- but it is available. For
a presentation, I might use -title()-. For a paper, I would use a
caption created by my text editor (or word processor should I use


On Wed, Feb 2, 2011 at 10:26 PM, Lucie Vlach
<> wrote:

> Thank you very much David!
> Fantastic... Both suggestions work just great. Exactly what I needed. This saved me tons of time.
> Many thanks to Nick Cox for -catplot-! (I will certainly credit next time).

On Behalf Of David Radwin []

> I think you want to specify this
>    ytitle("`: variable label my_variable2'")
> or perhaps something like this
>    ytitle("my_variable2 - `: variable label my_variable2'")
> which uses the extended macro function (-help extended_fcn-) for showing
> the label of a variable.
> Also, it is good form on Statalist to specify the author of a user-written
> program like -catplot- and where it is available, which in this case is
> Nick Cox and SSC. (I made the same mistake once. Perhaps it is because
> -catplot- is so indispensible to some of us that it seems like an official
> Stata command.)
>>] On Behalf Of Lucie Vlach

>> I need to plot my data, using catplot (works really well), but I would
>> like the "ytitle" to display my already existing variable label(s) (and
>> possible variable name, but label would be great).
>> I tried everything, but cannot get this right. Is there a way?
>> I know I can type in my own titles, but to speed this up, I would like
> to
>> display what I already have associated with each variable for a title.
>> This is what I am using now:
>> catplot   my_variable1, percent (my_variable2) by (my_variable2)
> ysize(3)
>> ytitle (My Title) blabel (bar, format (%4.1f))

*   For searches and help try:

© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index