version 7.0 log using "fig2.log", replace * * fig2.do * * N.B. The gprefs statements given below will * overide your Custom 1 color settings! * * This is a Stata program that produces figure 2 from * * Dupont WD and Plummer WD Jr. (2002) "Density Distribution Sunflower Plots" * Submitted for publication. URL pending. * * use "http://www.mc.vanderbilt.edu/prevmed/wddtext/data/2.20.Framingham.dta", clear * * Drop ten extreme outliers. * drop if bmi>55 * * Color choices for custom1 * * The following color choices attempt to make an analogy between data density * and a topographical map of an island in the sea. Hence individual data points * are blue (the sea), light sunflowers are brown on green (low altitude verdant * regions), and dark flowers are black on brown (high altitude rocky areas). * * Pen Color hue sat lum: red green blue * ----------------------------------------------- * 1 black: 0 0: 0 0 0 * 2 true blue: 160 240 120: 0 0 255 * 3 dark brown: 20 240 60: 128 64 0 * 4 light green: 50 240 200: 234 255 170 * 5 black: 0 0: 0 0 0 * 6 light brown: 20 240 120: 255 128 0 * * All pen widths are 9 * Background color is white * Graph size is 6 x 4 inches * * Define color scheme custom1 as specified above * gprefs set window scheme custom1 gprefs set custom1 background_color 255 255 255 gprefs set custom1 pen1_color 0 0 0 gprefs set custom1 pen2_color 0 0 255 gprefs set custom1 pen3_color 128 64 0 gprefs set custom1 pen4_color 234 255 170 gprefs set custom1 pen5_color 0 0 0 gprefs set custom1 pen6_color 255 128 0 gprefs set custom1 pen1_thick 9 gprefs set custom1 pen2_thick 9 gprefs set custom1 pen3_thick 9 gprefs set custom1 pen4_thick 9 gprefs set custom1 pen5_thick 9 gprefs set custom1 pen6_thick 9 gprefs set window xsize 6 gprefs set window ysize 4 * * Draw sunflower plot of diastolic blood pressure by body mass index * using the Framingham data (Levy 1999). * sunflower dbp bmi, xlabel(20 25 to 50) ylabel(50 70 to 150) log off