Skip to content

Commit

Permalink
v1.6
Browse files Browse the repository at this point in the history
  • Loading branch information
asjadnaqvi committed Oct 15, 2023
1 parent 82252a2 commit 18b484c
Show file tree
Hide file tree
Showing 19 changed files with 244 additions and 182 deletions.
4 changes: 2 additions & 2 deletions CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ authors:
- family-names: "Naqvi"
given-names: "Asjad"
title: "Stata package ``streamplot''"
version: 1.52
date-released: 2023-08-25
version: 1.6
date-released: 2023-10-15
url: "https://github.com/asjadnaqvi/stata-streamplot"
47 changes: 29 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@

---

# streamplot v1.52
(25 Aug 2023)
# streamplot v1.6
(15 Oct 2023)

This package provides the ability to generate stream plots in Stata. It is based on the [Streamplot Guide](https://medium.com/the-stata-guide/covid-19-visualizations-with-stata-part-10-stream-graphs-9d55db12318a) (December 2020).

Expand All @@ -24,7 +24,7 @@ SSC (**v1.51**):
ssc install streamplot, replace
```

GitHub (**v1.52**):
GitHub (**v1.6**):

```
net install streamplot, from("https://raw.githubusercontent.com/asjadnaqvi/stata-streamplot/main/installation/") replace
Expand Down Expand Up @@ -63,9 +63,12 @@ graph set window fontface "Arial Narrow"
The syntax for the latest version is as follows:

```
streamplot y x [if] [in], by(varname) [ palette(str) smooth(num) alpha(num) labcond(str) offset(num) droplow precent format
lcolor(str) lwidth(str) xlabel(str) ylabel(str) ylabsize(num) ylabcolor(str) recenter(top|mid|bot)
title(str) subtitle(str) note(str) xsize(num) ysize(num) scheme(str) name(str) ]
streamplot y x [if] [in], by(varname)
[ palette(str) smooth(num) labcond(str) offset(num) alpha(num) droplow yreverse cat(varname) recenter(top|mid|bot)
lcolor(str) lwidth(str) ylabsize(num) ylabcolor(color|palette) percent format(str) nolabel
xlabel(str) xtitle(str) ytitle(str) title(str) subtitle(str) note(str)
ysize(num) xsize(num) scheme(str) aspect(str) name(str) saving(str)
]
```

See the help file `help streamplot` for details.
Expand Down Expand Up @@ -124,34 +127,30 @@ streamplot new_cases date if date > 22400, by(region) smooth(6) recenter(top)

```
streamplot new_cases date if date > 22400, by(region) smooth(6) ///
title("My Stata stream plot") /// note("test the note") ///
labcond(> 20000) ylabsize(1.8) lc(black) lw(0.04)
labcond(20000) ylabsize(1.8) lc(black) lw(0.04)
```

<img src="/figures/streamplot3.png" height="600">


```
streamplot new_cases date if date > 22400, by(region) smooth(6) ///
title("My Stata stream plot") ///
labcond(> 20000) ylabsize(1.8) lc(black) lw(0.04) format(%12.0fc) offset(0.2)
labcond(20000) ylabsize(1.8) lc(black) lw(0.04) format(%12.0fc) offset(20)
```

<img src="/figures/streamplot3_1.png" height="600">


```
streamplot new_cases date if date > 22400, by(region) smooth(6) palette(CET D11) ///
title("My Stata stream plot") ///
labcond(> 20000) ylabsize(1.8) lc(black) lw(0.04) percent format(%3.2f) offset(0.2) ylabc(red)
labcond(2) ylabsize(1.8) lc(black) lw(0.04) percent format(%3.2f) offset(20) ylabc(red)
```

<img src="/figures/streamplot3_2.png" height="600">

```
streamplot new_cases date if date > 22400, by(region) smooth(6) palette(CET C7, reverse) ///
title("My Stata stream plot") ///
labcond(> 20000) ylabsize(1.8) lc(black) lw(0.04) percent format(%3.2f) offset(0.2) ylabc(palette)
streamplot new_cases date if date > 22400, by(region) smooth(6) palette(CET C6, reverse) ///
labcond(1) ylabsize(1.8) lc(black) lw(0.04) percent format(%3.2f) offset(20) ylabc(palette)
```

<img src="/figures/streamplot3_3.png" height="600">
Expand All @@ -166,7 +165,7 @@ local xmax = `r(max)'
streamplot new_cases date if date > 22400, by(region) smooth(6) palette(CET D02) ///
title("My Stata stream plot") ///
subtitle("Subtitle here") note("Note here") ///
labcond(> 20000) ylabsize(1.5) lc(white) lw(0.08) ///
labcond(20000) ylabsize(1.5) lc(white) lw(0.08) ///
xlabel(`xmin'(20)`xmax', angle(90)) xtitle("")
```

Expand All @@ -180,22 +179,34 @@ or a custom graph scheme:
```
streamplot new_cases date if date > 22600, by(region) smooth(6) palette(CET CBD1) ///
title("My Stata stream plot", size(6)) subtitle("with colorblind-friendly colors", size(4)) ///
labcond(> 20000) ylabs(2) lc(black) lw(0.03) offset(0.3) xtitle("") ///
labcond(20000) ylabs(2) lc(black) lw(0.03) offset(25) xtitle("") ///
scheme(neon)
```

where the dark background `neon` scheme is loaded from the [schemepack](https://github.com/asjadnaqvi/Stata-schemes) suite.
where the dark background `neon` scheme is loaded from the [schemepack](https://github.com/asjadnaqvi/stata-schemepack) suite.


<img src="/figures/streamplot5.png" height="600">






## Feedback

Please open an [issue](https://github.com/asjadnaqvi/stata-streamplot/issues) to report errors, feature enhancements, and/or other requests.


## Change log

**v1.6 (15 Oct 2023)**
- Major update with the `cat()` option added to compare top versus bottom streams.
- Option `yreverse` fixed.
- Option `nolab` fixed.
- Several internal routines rewritten and cleaned up.
- The option `percent()` is now defined in the 0-100 (or higher range). Changed from the 0-1 range.

**v1.52 (25 Aug 2023)**
- Support for `aspect()`, `saving()`, `xscale()`, and `graphregion()` added.

Expand Down
Binary file modified figures/streamplot1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified figures/streamplot2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified figures/streamplot2_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified figures/streamplot2_2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified figures/streamplot3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified figures/streamplot3_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified figures/streamplot3_2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified figures/streamplot3_3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified figures/streamplot4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified figures/streamplot5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified figures/streamplot6.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added figures/streamplot7.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added figures/streamplot8.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions installation/stata.toc
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
v 1.52
v 1.6
d STREAMPLOT: A package for creating stream plots in Stata
d
d Asjad Naqvi,
d [email protected]
d
d Distribution-Date: 20230825
d Distribution-Date: 20231015
d
d https://medium.com/the-stata-guide
d https://github.com/asjadnaqvi/Stata-schemes
Expand Down
Loading

0 comments on commit 18b484c

Please sign in to comment.