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]

From |
Grace Jessie <gracejessie@hotmail.com> |

To |
<statalist@hsphsun2.harvard.edu> |

Subject |
RE: st: how to rename the texts of the category variable in -graph bar-? |

Date |
Wed, 3 Nov 2010 03:09:29 +0000 |

Michael, thank you sincerely! It helps a lot. Grace ---------------------------------------- > Date: Tue, 2 Nov 2010 12:18:57 -0700 > From: Michael.Norman.Mitchell@gmail.com > To: statalist@hsphsun2.harvard.edu > Subject: Re: st: how to rename the texts of the category variable in -graph bar-? > > Dear Grace > > Thanks for creating an example that illustrates so clearly what you want to do. Here is > an example that addresses your first three questions > > sysuse nlsw88, clear > > * First - rename labels for union > label define newlab 0 "First title" 1 "Second title" > label values union newlab > > graph hbar wage, over( occ, axis(off) sort(1) ) /// > blabel( group, pos(base) color(bg) size(vlarge)) /// > ytitle( "" ) /// > by( union, /// > title("Average Hourly Wage, 1988, Women Aged 34-46") /// > note("Source: 1988 data from NLS, U.S. Dept. of Labor, Bureau of Labor Statistics") ) /// > aspectratio(2) xsize(3) ysize(6) > > First, the label define and label values allows you to change the titles of the individual > graphs by changing the value labels associated with the -by()- variable. > > Second, the -size(vlarge)- option (within -blabel()-) allows you to change the size of the > text. > > Third, the -aspectratio(2) xsize(3) ysize(6)- options give you control over the aspect > ratio, as well as the size of the graph in terms of the height and width. > > For your last question, you can use the graph recorder and save the -point and clicks-, > but it does not save the recording in a format that allows you to type them into the > review window. Instead, the recording can be replayed. See -help graph_editor##recorder- > for more information. > > 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-11-02 10.18 AM, Grace Jessie wrote: > > > > Dear statalists, > > I am a beginning learner of Stata's graph.I encountered some questions on -graph bar-. > > > > First, I want to rename the texts of the category variable "union" showed in > > http://www.ats.ucla.edu/stat/stata/Library/GraphExamples/code/grblab1.htm. > > For example, rename nonunion as union=0 and union as union=1, how to modify the command? > > > > Second,how to change the size of the texts? > > > > Third, I can change the Y size by clicking the -start graph editor-,then -graph > properties, then - > > Aspect/size. How to express this by command? > > > > Most importantly, is there a way to let State show the command in the results window > when I edit > > the graph in the graph window by clicking the -start graph editor- menu? > > Thank you for any help. > > > > Grace > > > > * > > * 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/ > > > 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-11-02 10.18 AM, Grace Jessie wrote: > > > > Dear statalists, > > I am a beginning learner of Stata's graph.I encountered some questions on -graph bar-. > > > > First, I want to rename the texts of the category variable "union" showed in > > http://www.ats.ucla.edu/stat/stata/Library/GraphExamples/code/grblab1.htm. > > For example, rename nonunion as union=0 and union as union=1, how to modify the command? > > > > Second,how to change the size of the texts? > > > > Third, I can change the Y size by clicking the -start graph editor-,then -graph properties, then - > > Aspect/size. How to express this by command? > > > > Most importantly, is there a way to let State show the command in the results window when I edit > > the graph in the graph window by clicking the -start graph editor- menu? > > Thank you for any help. > > > > Grace > > > > * > > * 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/

**References**:**st: how to rename the texts of the category variable in -graph bar-?***From:*Grace Jessie <gracejessie@hotmail.com>

**Re: st: how to rename the texts of the category variable in -graph bar-?***From:*"Michael N. Mitchell" <Michael.Norman.Mitchell@gmail.com>

- Prev by Date:
**Re: st: repeat same commands over hundreds of files** - Next by Date:
**st: AIC for Mixed-Effects Models** - Previous by thread:
**Re: st: how to rename the texts of the category variable in -graph bar-?** - Next by thread:
**RE: st: how to rename the texts of the category variable in -graph bar-?** - Index(es):