Graphics Reference
In-Depth Information
When all else fails
I hope that, by describing these errors, I can help you avoid some common errors. Here
are some additional ideas and resources to help you when you are struggling:
Build graphs slowly. Rather than trying to make a final graph all at once, try
to build the graph slowly adding, one option at a time. This is illustrated in In-
tro : Building graphs (29), where we took a complex graph and built it one piece at a
time. Building slowly helps us isolate problems to a particular option, which we can
then further investigate.
When possible, model graphs from existing examples. This topic strives to provide
examples to model from. For additional online examples, see Appendix : Online sup-
plements (382) for the companion web site for the topic, which links to additional
examples.
For more detailed information about the syntax of Stata graphics, see [ G ] graph .
Please remember that some of the graph commands available in Stata were added
after the printing of [ G ] graph but are documented via the help graph command.
See also Appendix : Online supplements (382), which has links to the online help that
are organized according to the table of contents of this topic.
Reach out to fellow Stata users, either local friends, friends at Statalist, or friends at
Stata tech support. See http://www.stata.com/support/ for more details.
11.6
Customizing schemes
This section shows how to customize your own schemes. Although schemes can look
complicated, it is possible to easily create some simple schemes on our own. Let's look at
the vg lgndc scheme as an example. This scheme is based on the s2color scheme but
changes the legend to display at the 9 o'clock position, in a single column, with the keys
stacked on top of the symbols. Here are the contents of that scheme:
#include s2color // start with the s2color scheme
clockdir legend position
9
// put the legend in the 9 o'clock position
numstyle legend cols
1
// make the legend display in 1 column
yesno legend stacked
yes // stack the keys & symbols on top of each other
gsize legend_key_gap
half_tiny // very, very small gap between key and label
gsize legend_row_gap
small
// somewhat larger gap between key/label pairs
Rather than creating the vg lgndc scheme from scratch, which would be very laborious,
we use the #include s2color statement to base this new scheme on the s2color scheme.
The subsequent statements change the position of the legend and the number of columns
in the legend and stack the legend keys and symbols upon each other.
Say that we liked the vg lgndc scheme but wanted to make our own version in which
the legend is in the 3 o'clock position instead of the 9 o'clock position, naming our version
legend3 . To do this, we would start the Stata do-file editor, for example, by typing doedit
and then type the following into it: (Of course, the scheme will work fine if we omit
comments after the double slashes.)
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