Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, statalist.org is already up and running.


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

Re: st: RE: Extending axis when using -catplot-


From   Nick Cox <njcoxstata@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: RE: Extending axis when using -catplot-
Date   Fri, 30 Mar 2012 00:31:09 +0100

-catplot- by default calls -graph hbar- and the response axis is the
y-axis, regardless of the fact that it is horizontal.
Nick

On Thu, Mar 29, 2012 at 10:20 PM, Lucie Vlach
<Lucie.Vlach@albertahealthservices.ca> wrote:
> I think I made this work with:    ylabel(0(10)50, labsize(small))
>
> I hope that is correct, at least it looks ok to me so far.

Lucie Vlach

> I am creating two graphs and then combining them into one for easy viewing. James data vs. everyone's data, in percentages.
>
> I like the look of -catplot- for these. (-catplot- is a user-written package by Nicholas J. Cox available from SSC)
>
> When I combine the two graphs, one ends the axis at 30% because the data has the highest bar reaching only max 30% and the second one ends at 40%, based on its data.
>
> Is there a way to extend the 30% scale to 40% on my shorter graph so that both graphs have the same length of the axis?
> Something like -xscale- etc? I cannot get this to work. I need to have the 'james' graph displaying scale that reaches at least 40%, even though data only goes to 30%.
>
> Thank you very much for any help!
>
> ============
> catplot   abc_groups, by(james) percent(james) ysize(2.5) ytitle("James in percent") blabel(bar, format(%4.1f))
> graph save Graph "james.gph"
>
> catplot   abc_groups, by(everyone) percent(everyone) ysize(2.5) ytitle("everyone in percent") blabel(bar, format(%4.1f))
> graph save Graph "everyone.gph"
>
> grc1leg "james.gph" "everyone.gph", cols(1)imargin(0 0 0 0) ycommon xcommon legendfrom("james.gph")
> =============
>

*
*   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/


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