Skip to content

Commit

Permalink
v1.31 patch
Browse files Browse the repository at this point in the history
  • Loading branch information
asjadnaqvi committed Jun 20, 2022
1 parent dae3eea commit 727cf2f
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 20 deletions.
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

![StataMin](https://img.shields.io/badge/stata-2015-blue) ![issues](https://img.shields.io/github/issues/asjadnaqvi/stata-bimap) ![license](https://img.shields.io/github/license/asjadnaqvi/stata-bimap) ![Stars](https://img.shields.io/github/stars/asjadnaqvi/stata-bimap) ![version](https://img.shields.io/github/v/release/asjadnaqvi/stata-bimap) ![release](https://img.shields.io/github/release-date/asjadnaqvi/stata-bimap)

# bimap v1.3
# bimap v1.31

This package provides the ability to draw bi-variate maps in Stata. It is based on the [Bi-variate maps Guide](https://medium.com/the-stata-guide/stata-graphs-bi-variate-maps-b1e96dd4c2be) that I released in December 2021.

Expand All @@ -15,7 +15,7 @@ The package can be installed from SSC (**v1.3**):
ssc install bimap, replace
```

Or it can be installed from GitHub (**v1.3**):
Or it can be installed from GitHub (**v1.31**):

```
net install bimap, from("https://raw.githubusercontent.com/asjadnaqvi/stata-bimap/main/installation/") replace
Expand Down Expand Up @@ -53,7 +53,7 @@ This command is a wrapper for `spmap` and assumes that you have shapefiles in St

## Syntax

The syntax for **v1.3** is as follows:
The syntax for **v1.31** is as follows:

```
Expand Down Expand Up @@ -226,6 +226,10 @@ Please open an [issue](https://github.com/asjadnaqvi/stata-bimap/issues) to repo

## Versions

**v1.31 (20 Jun 2022)**
- Error fix in cut-offs skipping the last shape file.
- Fixed color assignments to 3x3 groups. If a group was missing, the colors were wrongly assigned.

**v1.3 (26 May 2022)**
- Percent option added to legend to show box share (thanks to Kit Baum).
- Legend corner label made lighter for visibility.
Expand Down
20 changes: 11 additions & 9 deletions installation/bimap.ado
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
*! bimap v1.3
*! bimap v1.31 (20 Jun 2022): Fixed a floating point error and issue with color assignments.
*! Asjad Naqvi ([email protected])
*! 26 May 2022: added percent option. Color range fixes. New schemes. label fixes

*!
* v1.3: 26 May 2022: added percent option. Color range fixes. New schemes. label fixes
* v1.2: 05 May 2022. Category cut-offs, counts, error checks, bug fixes, new palettes
* v1.1: 14 Apr 2022. Stable release

Expand Down Expand Up @@ -44,18 +44,18 @@ version 15
// check dependencies
capture findfile spmap.ado
if _rc != 0 {
di as error "spmap package is missing. Install the {stata ssc install spmap, replace:spmap}."
di as error "spmap package is missing. Click here to install {stata ssc install spmap, replace:spmap}."
exit
}

capture findfile colorpalette.ado
if _rc != 0 {
di as error "palettes package is missing. Click here to install the {stata ssc install palettes, replace:palettes} and {stata ssc install colrspace, replace:colrspace} packages."
di as error "palettes package is missing. Click here to install {stata ssc install palettes, replace:palettes} and {stata ssc install colrspace, replace:colrspace}."
exit
}

marksample touse, strok
gettoken var2 var1 : varlist
gettoken var2 var1 : varlist // var1 = x, var2 = y

if `var1' == `var2' {
di as error "Both variables are the same. Please choose different variables."
Expand Down Expand Up @@ -84,7 +84,7 @@ qui {
local cut0 = r(min)
local cut1 = `cut0' + `interv'
local cut2 = `cut1' + `interv'
local cut3 = r(max)
local cut3 = r(max) + 1 // floating point fix

egen `cat_`var1'' = cut(`var1') if `touse', at(`cut0', `cut1' , `cut2', `cut3') icodes

Expand All @@ -95,7 +95,7 @@ qui {
local cut0 = r(min)
local cut1 = `cut0' + `interv'
local cut2 = `cut1' + `interv'
local cut3 = r(max)
local cut3 = r(max) + 1 // floating point fix

egen `cat_`var2'' = cut(`var2') if `touse', at(`cut0', `cut1' , `cut2', `cut3') icodes

Expand Down Expand Up @@ -204,6 +204,8 @@ qui {
}
}

** bottom left to bottom top, bottom middle to top middle, bottom right to top right

if "`palette'" == "pinkgreen" {
local color #e8e8e8 #dfb0d6 #be64ac #ace4e4 #a5add3 #8c62aa #5ac8c8 #5698b9 #3b4994
}
Expand Down Expand Up @@ -267,7 +269,7 @@ qui {
local colors `r(p)'

spmap `grp_cut' using "`using'", ///
id(_ID) clm(unique) fcolor("`colors'") ///
id(_ID) clm(custom) clb(0 1 2 3 4 5 6 7 8 9) fcolor("`colors'") ///
ocolor(`lc' ..) osize(`lw' ..) ///
ndocolor(`ndo' ..) ndsize(`lw' ..) ndfcolor(`ndf' ..) ///
`polygon' `polyline' `point' ///
Expand Down
5 changes: 3 additions & 2 deletions installation/bimap.pkg
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
v 1.3
v 1.31
d {bf:BIMAP}: Bi-variate maps
d
d
Expand All @@ -8,8 +8,9 @@ d KW: Stata
d KW: graphs
d KW: map
d KW: bivariate map
d Distribution-Date: 20220622
d
d This version: 26 May 2022
d This version: 20 Jun 2022
d First version: 08 Apr 2022
d License: MIT
d
Expand Down
10 changes: 5 additions & 5 deletions installation/bimap.sthlp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{smcl}
{* 26May2022}{...}
{* 30Jun2022}{...}
{hi:help bimap}{...}
{right:{browse "https://github.com/asjadnaqvi/stata-bimap":bimap v1.3 (GitHub)}}
{right:{browse "https://github.com/asjadnaqvi/stata-bimap":bimap v1.31 (GitHub)}}

{hline}

Expand Down Expand Up @@ -125,8 +125,8 @@ Additional examples on {browse "https://github.com/asjadnaqvi/stata-bimap":GitHu

{title:Package details}

Version : {bf:bimap} v1.3
This release : 26 May 2022
Version : {bf:bimap} v1.31
This release : 20 Jun 2022
First release: 08 Apr 2022
Repository : {browse "https://github.com/asjadnaqvi/stata-bimap":GitHub}
Keywords : Stata, graph, bi-variate, map
Expand All @@ -140,7 +140,7 @@ Twitter : {browse "https://twitter.com/AsjadNaqvi":@AsjadNaqvi}

{title:Acknowledgements}

Ruth Watkinson found an error in the grouping code. Pierre-Henri Bono suggested passthru options for {cmd:spmap}. Kit Baum requested the {it:percent} option and fixes to label colors.
Ruth Watkinson found an error in the grouping code. Pierre-Henri Bono suggested {it:passthru} options for {cmd:spmap}. Kit Baum requested the {it:percent} option and fixes to label colors. Mattias Öhman found an error in cut-offs and color assignments with missing groups.

{title:Feedback}

Expand Down
2 changes: 1 addition & 1 deletion installation/stata.toc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
v 1.2
v 1.31
d BIMAP: A package for creating bivariate maps.
d
d Asjad Naqvi,
Expand Down

0 comments on commit 727cf2f

Please sign in to comment.