Graphics Reference
In-Depth Information
The box option places a box around the title. Note that we place a comma before the
box option. Now, suppose that we are content with the existing legend but wish to make
the legend display in a single column.
. twoway scatter propval100 popden rent700, xtitle( , box) legend(cols(1))
Based on the syntax from the title() option, we might have been tempted to have
typed legend( , cols(1)) , but that would have led to an error. Some options, like the
legend() option, simply take a list of options with no comma permitted.
Using options in the wrong context
-axis from their
default position at the bottom of the graph to the alternate position at the top of the graph.
Consider the example below. Our goal is to move the labels for the
x
. twoway scatter propval100 rent700, xlabel( , alternate)
This command executes, but it does not have the desired effect. Instead, it staggers the
labels of the
-axis, alternating between the upper and lower positions. In this context,
the alternate option means something different than we had intended. What we really
wanted to specify was xscale(alternate) :
x
. twoway scatter propval100 rent700, xscale(alternate)
-axis to the alternate position and has the
desired effect. Another mistake we might have made was to put the alternate option as
an overall option. This command is shown below with the result:
This command moves the entire scale of the
x
. twoway scatter propval100 rent700, alternate
option alternate not allowed
invalid syntax
r(198);
In this case, we are half-right. There is an option alternate , but we have used it in the
wrong context, yielding the syntax error. In such cases, remember that the option we are
specifying may be right, but we just need to put it into the right context.
Options appear to have no effect
When we add an option to a graph, we generally expect to see the effect of adding the
option. However, sometimes adding an option has no effect. Consider this example:
. twoway scatter propval100 rent700, mlabpos(12)
This command executes, but nothing changes as a result of including the mlabpos(12)
option, which would change the position of the marker labels to the 12 o'clock position.
There are no marker labels in the graph, so adding this option has no effect. We would have
to use the mlabel() option to add marker labels before we saw the effect of this option.
Consider another example, which is a bit more subtle. We would like to make the line
(periphery) of the marker thick. When we run the following command, we do not see any
effect from adding the mlwidth(thick) option:
. twoway scatter propval100 rent700, mlwidth(thick)
The electronic form of this topic is solely for direct use at UCLA and only by faculty, students, and staff of UCLA.
Search WWH ::




Custom Search