A Short Introduction to Graphs
Graphs are an important part of Stata. However, a bit more than elsewhere I rely on ado files, i.e., command files that were written by expert Stata users to complement the core Stata package. These files have to be installed on your computer before the first use. Whenever I refer to such a file, I will point out how to do this.
Until April 2025, this part of the Stata guide started with an entry on univariate charts, followed by another one on bivariate charts. With both entries growing, and with many commands appearing in both entries, this became too clumsy, and now the first entries are organized as follows:
- Cleveland dot plots
- Strip plots, histograms, dot plots, kernel density and violin plots: Data and distributions
- Quantile plots / cumulative density plots
- Scatterplots and line plots
- Charts for discrete data (
graph bar
,catplot
,tabplot
and discrete histograms)
Please note that the next part of this guide, Elementary Data Analysis, starts with another entry on graphs: What little I have to say on the topic of Exploratory Data Analysis (EDA) (it is not enough, of course), can be found in the entry on Stem-and-leaf diagrams and box plots: Exploratory data analysis graphs
The entries denoted thus far are focussed on the basic commands required to create a crude version of the respective graph, sometimes complemented by a few options to change how the graph appears. More thorough discussions of specific aspects of graphs will be found in the entries that follow, to wit:
There are also section on some general options, on naming and saving of graphs, on overlaying graphs and finally on combining graphs.
© W. Ludwig-Mayerhofer, Stata Guide | Last update: 20 Apr 2025