![]() You may use the alternate (or alt) option which will create an offset between labels: This may sometimes cause trouble if there are many labels or labels are long. Normally, labels are displayed side by side on the x axis. Histogram isced, discrete gap(25) xlabel(1 "Low" 2 "Intermediate" 3 "High") Histogram isced, discrete gap(25) xlabel(, valuelabel)īut you may also submit the labels to be used in the graph explicitly, which is particularly useful if the existing value labels are somewhat longish, such as in: The way to achieve this is the valuelabels suboption, as in ![]() In other cases, you have to request Stata explicitly if value labels are to be used as axis labels. If the categories have been labeled, Stata will use those labels only if a variable is used to represent different groups, such as when a box plot is created together with the over option. In most cases, Stata will use the numerical values (representing the different categories) of a variable to label the axes of a graph. In combination with a definition of the values to be labeled it would look like this: If this sub-option is used alone, the command will look like this: If you wish to display them horizontally, you have to add a (sub-)option to the ylabel command. The values on the y axis by default are displayed vertically. The same rules apply to the ylabel command. For instance, if the x axis ranges from 0 to 10,000, you may wish to display values at 0, 2000, 4000 and so forth. You can influence which values are displayed (and ticked) on each axis. If the graph you wish to produce does not contain grid lines by default, this can be amended via the grid option, as in:Ĭonversely, if you wish to suppress grid lines that are displayed by default, you may use the nogrid option. Often, the default display of a Stata graph includes grid lines, typically on the y axis. In such cases, try adding exclude0 to the list of options. Some graphs, such as bar charts, begin the y axis at 0 (zero) by default, and this cannot be overridden solely with ysc, even if zero is not the smallest value in the data. If, say, the minimum value of y is 0, you may omit this value in ysc, mentioning only the upper value of 50 within the parenthesis. Will set the minimum of both axes to 0, the maximum of the x axis to 1 and the maximum of the y axis to 50. Note that you cannot restrict display of values to a smaller set of values than are present in the data all you can do is to expand the axes beyond the smallest and / or largest values. You can determine the range of the axes via xsc and ysc. The final subsection of this section gives some hints that refer to this case. For instance, a box-and-whisker plot showing the distribution of a variable for several groups is still considered a univariate graph hence you cannot use options that refer to the x axis. Whereas the former have an x and a y axis, the latter have only a y axis, even though they may sometimes "look like" twoway graphs. Prologue: Note that there is a difference between twoway graphs (the most common variety) and univariate (or oneway) graphs.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |