Skip to content

Commit 962ca13

Browse files
committed
v1.4 updates
1 parent b43b1dd commit 962ca13

File tree

2 files changed

+235
-27
lines changed

2 files changed

+235
-27
lines changed

README.md

Lines changed: 22 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Link to the Medium article that describes these schemes: [Stata graph schemes by
1313

1414
Note that scheme file options, e.g. colors, lines, sizes, etc. might be subject to minor adjustments to improve their overall visual quality.
1515

16-
## How to install and use SCHEMEPACK
16+
## Install
1717

1818
To install SCHEMEPACK, you can either get them directly from SSC (**v1.3**):
1919

@@ -31,7 +31,7 @@ net install schemepack, from("https://raw.githubusercontent.com/asjadnaqvi/stata
3131

3232
Once installed, please see `help schemepack` for the scheme descriptions and test them out.
3333

34-
You can also download and run the [scheme_test.do](scheme_test.do) dofile to test various graph schemes that uses this test data:
34+
You can also download and run the [./data/scheme_test.do](scheme_test.do) dofile to test various graph schemes that uses this test data:
3535

3636
```
3737
use "https://github.com/asjadnaqvi/stata-schemepack/blob/main/data/scheme_test.dta?raw=true", clear
@@ -40,34 +40,9 @@ use "https://github.com/asjadnaqvi/stata-schemepack/blob/main/data/scheme_test.d
4040
or try them out on your own datasets! If you want to revert back to the default Stata s2 scheme, then type `set scheme s2color`. Note that you can permanently set a scheme by typing `set scheme <name>, perm`.
4141

4242

43-
4443
Please report errors or bugs or suggestions in the [Issues](https://github.com/asjadnaqvi/stata-schemepack/issues) section.
4544

4645

47-
48-
### Change log
49-
* 08 Nov 2022: v1.4 release. Fixes and corrections to schemes. GitHub folder renamed to stata-schemepack to align it with other dataviz packages.
50-
* 08 Sep 2022: Minor fixes for v1.3
51-
* 14 Aug 2022: Bug fixes to schemes files. Ukraine scheme slightly desaturated. Four new schemes added: cblind1 (color-blind friendly), tab1, tab2, tab3 (qualitative colors).
52-
* 05 Mar 2022: A new scheme based on Ukraine's flag colors.
53-
* 15 Nov 2021: A new scheme based on Taylor Swift's Red album colors added. Minor fixes to the help file.
54-
* 28 Oct 2021: *MAJOR UPDATE*: schemes released on SSC (`ssc install schemepack, replace`). They collection has been renamed from `tsg_schemes` to `schemepack` to make it more generic and easier to remember. Black schemes have a notch darker background (its not pure black). Bar graph outlines adjusted to make them more visible. Otherwise some schemes were blending into the background.
55-
* 28 Jun 2021: Minor errors in templates have been fixed. For example bar labels were showing in the wrong color in the black themes. The test file has been reduced in size. The preview graphs have been regenerated. The number of graphs show in the preview below have been reduced except for the tableau schemes. All files exist in the figure folder though.
56-
* 26 Jun 2021: Two new schemes added: neon and rainbow. Neon tests a new and more generic scheme generator script. Rainbow celebrates the 2021 Pride month and introduces the 6 pride flag colors in the schemes. This scheme is fairly limited in the sense that it only has six colors. But these are more than enough for presentations etc. This is also derived from the generic scheme template used for the Neon scheme.
57-
* 15 Jun 2021: Schemes updated to make them compatible with Stata 15 and earlier. The s2-scheme.scheme was updated to a new version in 2019 and the older scheme version was giving errors.
58-
* 16 Apr 2021: Very minor fixes to some colors. Histograms fixed and added to the graphs. Following schemes added: **brbg**, **piyg**, **ptol**, **jet**, **w3d**
59-
* 08 Apr 2021: Repository created with pkg file and the following schemes added: **tableau**, **cividis**, **viridis**, **hue**
60-
61-
### How can you support the schemes?
62-
63-
You can support the schemes by using them :smirk:
64-
65-
You can also:
66-
67-
[!["Buy Me A Coffee!!!"](https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png)](https://www.buymeacoffee.com/asjadnaqvi)
68-
69-
70-
7146
# Preview
7247

7348
A preview of the schemes is given below. The latest ones are put on top. Not every scheme has been fine tuned for each and every aspect. Regardless, all elements can be modified from the graph interface window, which overwrite the scheme defaults. Some schemes are fairly robust. For example, **white_tableau** and **white_w3d** work really well and I use them most of the time. Some themes are great for presentations. For example, the dark themes on dark backgrounds, or gg schemes which keep the focus on the graph.
@@ -328,3 +303,23 @@ Celebrating pride (2021 edition):
328303

329304

330305

306+
### Change log
307+
* 08 Nov 2022: v1.4 release. Fixes and corrections to schemes. GitHub folder renamed to stata-schemepack to align it with other dataviz packages.
308+
* 08 Sep 2022: Minor fixes for v1.3
309+
* 14 Aug 2022: Bug fixes to schemes files. Ukraine scheme slightly desaturated. Four new schemes added: cblind1 (color-blind friendly), tab1, tab2, tab3 (qualitative colors).
310+
* 05 Mar 2022: A new scheme based on Ukraine's flag colors.
311+
* 15 Nov 2021: A new scheme based on Taylor Swift's Red album colors added. Minor fixes to the help file.
312+
* 28 Oct 2021: *MAJOR UPDATE*: schemes released on SSC (`ssc install schemepack, replace`). They collection has been renamed from `tsg_schemes` to `schemepack` to make it more generic and easier to remember. Black schemes have a notch darker background (its not pure black). Bar graph outlines adjusted to make them more visible. Otherwise some schemes were blending into the background.
313+
* 28 Jun 2021: Minor errors in templates have been fixed. For example bar labels were showing in the wrong color in the black themes. The test file has been reduced in size. The preview graphs have been regenerated. The number of graphs show in the preview below have been reduced except for the tableau schemes. All files exist in the figure folder though.
314+
* 26 Jun 2021: Two new schemes added: neon and rainbow. Neon tests a new and more generic scheme generator script. Rainbow celebrates the 2021 Pride month and introduces the 6 pride flag colors in the schemes. This scheme is fairly limited in the sense that it only has six colors. But these are more than enough for presentations etc. This is also derived from the generic scheme template used for the Neon scheme.
315+
* 15 Jun 2021: Schemes updated to make them compatible with Stata 15 and earlier. The s2-scheme.scheme was updated to a new version in 2019 and the older scheme version was giving errors.
316+
* 16 Apr 2021: Very minor fixes to some colors. Histograms fixed and added to the graphs. Following schemes added: **brbg**, **piyg**, **ptol**, **jet**, **w3d**
317+
* 08 Apr 2021: Repository created with pkg file and the following schemes added: **tableau**, **cividis**, **viridis**, **hue**
318+
319+
### How can you support the schemes?
320+
321+
You can support the schemes by using them :smirk:
322+
323+
You can also:
324+
325+
[!["Buy Me A Coffee!!!"](https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png)](https://www.buymeacoffee.com/asjadnaqvi)

data/scheme_test.do

Lines changed: 213 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,213 @@
1+
****************************
2+
****************************
3+
*** ***
4+
*** schemepack v1.4 ***
5+
*** ***
6+
*** Asjad Naqvi ***
7+
*** ***
8+
*** The Stata Guide ***
9+
*** on Medium ***
10+
*** ***
11+
*** 08 Nov 2022 ***
12+
*** ***
13+
****************************
14+
****************************
15+
16+
* https://github.com/asjadnaqvi/stata-schemepack
17+
* https://medium.com/the-stata-guide
18+
19+
// report errors here:
20+
* https://github.com/asjadnaqvi/stata-schemepack/issues
21+
22+
23+
24+
clear
25+
26+
// See github page to check if there are version differences between SSC and GitHub
27+
28+
// install from ssc
29+
*ssc install schemepack, replace
30+
31+
// OR install from GitHub
32+
*net install schemepack, from("https://raw.githubusercontent.com/asjadnaqvi/stata-schemepack/main/installation/") replace
33+
34+
// read the data
35+
use "https://github.com/asjadnaqvi/Stata-schemes/blob/main/scheme_test.dta?raw=true", clear
36+
37+
// you either type:
38+
* set scheme white_tableau
39+
* set scheme black_tableau
40+
* set scheme gg_tableau
41+
42+
// or permanently set the theme
43+
* set scheme white_tableau, perm
44+
45+
// or set it in a graph directly
46+
* twoway (scatter var2 date if group==1), scheme(white_tableau)
47+
48+
49+
// Feel free to try these on your own datasets and please report errors if any
50+
51+
52+
set scheme white_tableau
53+
54+
55+
*****************************************
56+
*********** TEST GRAPHS BELOW ***********
57+
*****************************************
58+
59+
// note that some schemes might only have only 6 or 8 color. Therefore the cycle repeats once the last defined
60+
// color of a scheme is reached.
61+
62+
*** Scatter plot
63+
64+
twoway ///
65+
(scatter var2 date if group==1) ///
66+
(scatter var2 date if group==2) ///
67+
(scatter var2 date if group==3) ///
68+
(scatter var2 date if group==4) ///
69+
(scatter var2 date if group==5) ///
70+
(scatter var2 date if group==6) ///
71+
(scatter var2 date if group==7) ///
72+
(scatter var2 date if group==8) ///
73+
(scatter var2 date if group==9) ///
74+
(scatter var2 date if group==10) ///
75+
(scatter var2 date if group==11) ///
76+
(scatter var2 date if group==12) ///
77+
, ///
78+
legend(order(1 "group1" 2 "group2" 3 "group3" 4 "group4" 5 "group5" 6 "group6" 7 "group7" 8 "group8" 9 "group9" 10 "group10" 11 "group11" 12 "group12")) ///
79+
title("Scatter plot") ///
80+
note("By the Stata Guide")
81+
82+
83+
84+
85+
*** Line graph
86+
87+
twoway ///
88+
(line var2 date if group==1) ///
89+
(line var2 date if group==2) ///
90+
(line var2 date if group==3) ///
91+
(line var2 date if group==4) ///
92+
(line var2 date if group==5) ///
93+
(line var2 date if group==6) ///
94+
(line var2 date if group==7) ///
95+
(line var2 date if group==8) ///
96+
(line var2 date if group==9) ///
97+
(line var2 date if group==10) ///
98+
(line var2 date if group==11) ///
99+
(line var2 date if group==12) ///
100+
, ///
101+
legend(order(1 "group1" 2 "group2" 3 "group3" 4 "group4" 5 "group5" 6 "group6" 7 "group7" 8 "group8" 9 "group9" 10 "group10" 11 "group11" 12 "group12")) ///
102+
title("Line plot") ///
103+
note("The Stata Guide", size(vsmall))
104+
105+
106+
107+
108+
109+
*** Pie chart
110+
111+
graph pie var2 if group <= 10, ///
112+
over(group) plabel(_all percent, format(%9.2f)) ///
113+
line(lcolor(black) lwidth(vvthin)) /// // outline colors have to be manually added
114+
title("Pie plot") ///
115+
note("The Stata Guide", size(vsmall))
116+
117+
118+
119+
*** Box plot
120+
121+
graph box ///
122+
var* ///
123+
, ///
124+
title("Box plot") ///
125+
note("The Stata Guide", size(vsmall))
126+
127+
*** Histogram
128+
129+
histogram var4, percent ///
130+
title("Histogram") ///
131+
note("The Stata Guide", size(vsmall))
132+
133+
*** Bar graph
134+
135+
graph bar ///
136+
var* ///
137+
, ///
138+
blabel(bar, format(%9.2f)) ///
139+
title("Bar graph") ///
140+
note("The Stata Guide", size(vsmall))
141+
142+
143+
144+
*** Horizontal bar graph
145+
146+
graph hbar (mean) ///
147+
var* ///
148+
if group <= 6, ///
149+
over(group) ///
150+
percentages stack ///
151+
legend(order(1 "Var 1" 2 "Var 2" 3 "Var 3" 4 "Var 4" 5 "Var 5" 6 "Var 6")) ///
152+
title("Bar graph") ///
153+
note("The Stata Guide", size(vsmall))
154+
155+
156+
*** Confidence bands
157+
158+
twoway ///
159+
(lpolyci var1 var9, fcolor(%80)) ///
160+
(lpolyci var2 var9, fcolor(%80)) ///
161+
(lpolyci var3 var9, fcolor(%80)) ///
162+
, ///
163+
title("Confidence Interval") ///
164+
note("The Stata Guide", size(vsmall))
165+
166+
167+
*** Range graphs
168+
169+
twoway ///
170+
(rcapsym var2 var3 date if group==1, sort) ///
171+
(rcapsym var2 var3 date if group==2, sort) ///
172+
, ///
173+
title("Range plots") ///
174+
note("The Stata Guide", size(vsmall))
175+
176+
177+
*** Area graphs
178+
179+
twoway ///
180+
(area den1d den1x, fcolor(%50)) ///
181+
(area gen2d gen2x, fcolor(%50)) ///
182+
(area gen3d gen3x, fcolor(%50)), ///
183+
title("Density plots") ///
184+
note("The Stata Guide", size(vsmall))
185+
186+
187+
*** Scatter labels
188+
189+
twoway ///
190+
(scatter var2 var1, mlabel(group)) ///
191+
if date==22320 ///
192+
, ///
193+
title("Confidence Interval") ///
194+
note("The Stata Guide", size(vsmall))
195+
196+
197+
*** By graphs
198+
199+
twoway ///
200+
(scatter var2 var1) ///
201+
if group <= 12, ///
202+
by(group, yrescale xrescale) ///
203+
by(, title("By graphs") note("The Stata Guide", size(vsmall)))
204+
205+
206+
207+
208+
//// ******* END OF FILE ******* \\\\
209+
210+
211+
212+
213+

0 commit comments

Comments
 (0)