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: bar graph axis color- frustrated


From   "Michael N. Mitchell" <Michael.Norman.Mitchell@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: bar graph axis color- frustrated
Date   Thu, 10 Jun 2010 17:44:06 -0700

Dear Ricardo

  This is a complete stumper... I totally understand why you are so frustrated.

The problem lies with the fact that Stata is conceptualizing the left axis as the "x" axis because it is the axis that contains the categorical variable. Thus, the -yscale- options impact the bottom axis (with, in this example, -weight- and -price-). So, to alter the line, we would need to refer to the -xscale()- , which is not a legal thing to refer to. For such graphs, Stata does not permit the -xscale()- option.

The only way I can figure to do this is with the graph editor. I made a little movie of how to do this at

  http://screencast.com/t/YjhlZGM2MTI

If you need to do this for multiple graphs, you can use the graph recorder to record this process, and then play back the recorded file against other graphs (see -help graph play-).

  I hope this helps!

Michael N. Mitchell
Data Management Using Stata      - http://www.stata.com/bookstore/dmus.html
A Visual Guide to Stata Graphics - http://www.stata.com/bookstore/vgsg.html
Stata tidbit of the week         - http://www.MichaelNormanMitchell.com



On 2010-06-10 4.59 PM, Ricardo Ovaldia wrote:
Thank you Michael. Here is a simplified version of my graph which is much more complex:

sysuse auto, clear
graph hbar   weight price, ysc(off)

I want the axis on right side (the base of the bars) to be a color other than black (white or clear would work).

But the way, I have your book. It is great and extremely useful.

Ricardo Ovaldia, MS
Statistician
Oklahoma City, OK


--- On Thu, 6/10/10, Michael Mitchell<Michael.Norman.Mitchell@gmail.com>  wrote:

From: Michael Mitchell<Michael.Norman.Mitchell@gmail.com>
Subject: Re: st: bar graph axis color- frustrated
To: statalist@hsphsun2.harvard.edu
Date: Thursday, June 10, 2010, 5:31 PM
Dear Ricardo

   I think it would help if you sent the Stata command
that you are
issuing, and an example of the desired colors of the bars
you want. I
am having trouble figuring out the problem you are
encountering.

Best regards,

Michael N. Mitchell
Data Management Using Stata      - http://www.stata.com/bookstore/dmus.html
A Visual Guide to Stata Graphics - http://www.stata.com/bookstore/vgsg.html
Stata tidbit of the week
    - http://www.MichaelNormanMitchell.com

On Thu, Jun 10, 2010 at 2:35 PM, Ricardo Ovaldia<ovaldia@yahoo.com>
wrote:
I continue to struggle with trying to change the color
of the y-axis of a horizontal bar graph. Although this seems
like it should be a pretty basic thing to be able to do, I
have not found a satisfactory solution. Note that I am not
using the -over()- option.

Ricardo Ovaldia, MS
Statistician
Oklahoma City, OK



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


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





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