From 727cf2fce2cea29b1d0b3d755c3de83a6807defb Mon Sep 17 00:00:00 2001 From: Asjad <38498046+asjadnaqvi@users.noreply.github.com> Date: Mon, 20 Jun 2022 15:58:33 +0200 Subject: [PATCH] v1.31 patch --- README.md | 10 +++++++--- installation/bimap.ado | 20 +++++++++++--------- installation/bimap.pkg | 5 +++-- installation/bimap.sthlp | 10 +++++----- installation/stata.toc | 2 +- 5 files changed, 27 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index 7717943..8f45d33 100644 --- a/README.md +++ b/README.md @@ -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. @@ -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 @@ -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: ``` @@ -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. diff --git a/installation/bimap.ado b/installation/bimap.ado index 26a354f..ecaf713 100644 --- a/installation/bimap.ado +++ b/installation/bimap.ado @@ -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 (asjadnaqvi@gmail.com) -*! 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 @@ -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." @@ -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 @@ -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 @@ -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 } @@ -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' /// diff --git a/installation/bimap.pkg b/installation/bimap.pkg index e142424..8cc0d53 100644 --- a/installation/bimap.pkg +++ b/installation/bimap.pkg @@ -1,4 +1,4 @@ -v 1.3 +v 1.31 d {bf:BIMAP}: Bi-variate maps d d @@ -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 diff --git a/installation/bimap.sthlp b/installation/bimap.sthlp index d12b695..4abc81e 100644 --- a/installation/bimap.sthlp +++ b/installation/bimap.sthlp @@ -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} @@ -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 @@ -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} diff --git a/installation/stata.toc b/installation/stata.toc index 287e695..88f63c6 100644 --- a/installation/stata.toc +++ b/installation/stata.toc @@ -1,4 +1,4 @@ -v 1.2 +v 1.31 d BIMAP: A package for creating bivariate maps. d d Asjad Naqvi,