Numbers less than 1 lighten the color and numbers greater than 1 darken the color. Named colors can be modified with the syntax “color*#. Color Swatch GeneratorĪlthough Stata can generate colors using any set of RGB values, for a variety of reasons* I found it easiest to work with the built-in named colors. Pro tip: remember to reset the plot macro to ” ” (empty) (or use a new macro name each time) or you will get unpleasant results with repeated graphs. In this code, each line gets added to the macro plotlist. Local plotlist "`plotlist' (code_for_one_line )" Trick 2 is to use Stata macros to generate the lines of a plot. Or self-labeling scatterplots by having a label for all values. Trick 1 that I have learned is to generate self-labeling lines by creating a variable that has the label only in the last value of the x-axis variable, year in my case. UPDATED CODE to retrieve, calculate and print RGB values is included in a copy of this post on my academic blog. This is useful to me because I am generating line graphs showing the trends for 17 different offense groups. I realize all the cool kids have switched to R, but if you still work with Stata, you may be interested in some routines I worked up to generate color and line pattern palettes and customize graphs fairly easily with macros and loops.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |