Bookmark and Share

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]

Re: st: how to rename the texts of the category variable in -graph bar-?


From   "Michael N. Mitchell" <[email protected]>
To   [email protected]
Subject   Re: st: how to rename the texts of the category variable in -graph bar-?
Date   Tue, 02 Nov 2010 12:18:57 -0700

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/


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