Nicolas J. Duquette
On this page, I post bits of code I intend to serve as public goods. If you are looking for code specific to individual projects, replication files are linked next to individual papers and projects on the research page.
Each of the following is a code template for producing a plot using Stata's twoway command. Each example has been tuned to improve readability relative to Stata's graphics defaults.
I have included example data and verbose comments in each file. While many of the changes could be bundled into a scheme, I prefer to leave graphics options explicit in the template. This makes further changes specific to a particular plot simpler to make (and thus defaults less sticky).
I do not expect citations or attributions for these, but do appreciate hearing if you find these useful or have suggestions.
I track major milestones of my research, and in 2018 I tweeted a visualization of my research progress. It turned out that other scholars wanted to plot their own work. The plot below is a cleaner, self-contained version of the original chart.
Download the Stata Do-file If you use R instead of Stata, Mark Scherz has created a version of this visualization in ggplot.
These basic scatterplots tweak Stata's defaults to emphasize the data being visualized.
The following chart plots series over time using a cleaner design as well as a palette of colors and set of shapes that are easily distinguishable under a variety of colorblindness conditions. Specifically, I used the color-testing tool Coolors.
This site is built on Tufte CSS, a set of web layout rules inspired by the books and ideas of Edward Tufte. The design of the research page is further influenced by the professional web page of Achyuta Adhvaryu.