![]() ![]() Replace intenS=word("`intenlist'",`inten') if case=`ii' Replace basecolor=word("`colorlist'",`color') if case=`ii' ** fill in the strings with colors and intensities ** This code generates the data for the plotsĭisp "ncolor `ncolor' ninten `ninten' ncases `ncases'" Local yrange "`lowint' (`edgegap') `maxint'" ** This code to get a decent intensity range in the graph regardless of entries Local intnumlist=subinstr("`intenlist'"," ",", ".) // a numlist with commas Local colorlist "ebblue eltblue orange orange_red red uwred purple" * uwred is a color I created and saved in my personal ado file * edits code so colors now print in the order of colorlist * uses syntax "scatter y1 y2 x" to print two-line labels * calculates and prints RGB values as well as color names style file for named color and identifies RGB code ![]() * Stata program to generate color swatches I also tested creating my own color (uwred) and saving it in a. But I wanted to see ranges of colors using the intensity values across several different named colors. The ado file full_palette generates a swatch of the 66 named colors in Stata, with their RGB values (you can access this by typing help full_palette and installing the ado), and the built-in ado palette color will show color samples and the RGB values for two colors (type help palette color to see the syntax of the command). 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 to include RGB values in the color palette and to give the formulas for calculating them from intensities. Everybody else may wish to give it a pass. This is a “stats nerd” post that assumes the reader uses Stata, a statistical package. Are there no new features? More worryingly, do the developers see no scope for new features in graphs? Items I've commented on in the past include a wider range of plotting symbols for points, the problem of aligning Y axes when multiple graphs are stacked, and a way to refer within a graph command to a "pen color" in a style.A few readers may be interested in how I used Stata to create the color scheme for the offenses in the graphs I’ve posted recently. I can see no reference in the release notes to enhancements to the graphics commands, and the Graphics manual has no "What's new?". Preferably this can be implemented by allowing transparent coloring in all graphs.įrom: ] On Behalf Of Allan Reese (Cefas) Graphs with overlapping areas shaded in different colors would also be very useful (similar to SSC's -drarea-). PS I'm hoping for a revamp of -graph combine-, so that one can combine graphs by matching plot regions axes rather than graph regions axes. Hopefully in the next one or two release we'll get what we want! I think I'm also a bit disappointed there's no improvement to the graphics system or to Mata, but I think Stata 13 is a massive release and the features that have been introduced make a lot of sense. Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |