Skip to content

Commit

Permalink
v1.33
Browse files Browse the repository at this point in the history
  • Loading branch information
asjadnaqvi committed Sep 29, 2022
1 parent f72d3e6 commit 7bf5e35
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 30 deletions.
12 changes: 8 additions & 4 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.32
# bimap v1.33

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).

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

Or it can be installed from GitHub (**v1.32**):
Or it can be installed from GitHub (**v1.33**):

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

## Syntax

The syntax for **v1.32** is as follows:
The syntax for **v1.33** is as follows:

```
bimap vary varx [if] [in], cut(option) palette(option)
[ count percent values ocolor(str) osize(str) ndocolor(str) ndsize(str) ndocolor(str)
polygon(str) line(str) point(str) label(str)
textx(string) texty(str) TEXTLABSize(num) TEXTSize(num) BOXsize(num) xscale(num) yscale(num)
textx(string) texty(str) TEXTLABSize(num) TEXTSize(num) TEXGap(num) BOXsize(num) xscale(num) yscale(num)
title(str) subtitle(str) note(str) name(srt) scheme(str) ]
```

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

## Versions

**v1.33 (29 Sep 2022)**
- Bug fixes to `spmap` passthru options.
- Add a new option `textgap` to allow adjustment of the distance of axes labels to the legend.

**v1.32 (19 Aug 2022)**
- Fixed an error in variable name comparisons (thanks to Cristian Jordan Diaz).

Expand Down
16 changes: 8 additions & 8 deletions installation/bimap.ado
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
*! bimap v1.32 (19 Aug 2022)
*! bimap v1.33 (29 Sep 2022)
*! Asjad Naqvi ([email protected])
*
* v1.33 (29 Sep 2022): Passthru options fixed.
* v1.32 (19 Aug 2022): Fixed a bug in variable comparisons
* v1.31 (20 Jun 2022): Fixed a floating point error and issue with color assignments.
* v1.3 (26 May 2022): added percent option. Color range fixes. New schemes. label fixes
Expand All @@ -26,12 +27,11 @@ version 15

syntax varlist(min=2 max=2 numeric) [if] [in] using/ , ///
cut(string) palette(string) ///
[ count percent BOXsize(real 8) textx(string) texty(string) xscale(real 30) yscale(real 100) TEXTLABSize(real 2) TEXTSize(real 2.5) values ] ///
[ count percent BOXsize(real 8) textx(string) texty(string) TEXTGap(real 2) xscale(real 30) yscale(real 100) TEXTLABSize(real 2) TEXTSize(real 2.5) values ] ///
[ polygon(passthru) line(passthru) point(passthru) label(passthru) ] ///
[ ocolor(string) osize(string) ] ///
[ ndocolor(string) ndsize(string) ndfcolor(string) ] ///
[ title(passthru) subtitle(passthru) note(passthru) name(passthru) ] ///
[ allopt graphopts(string asis) * ]
[ title(passthru) subtitle(passthru) note(passthru) name(passthru) ]


if (substr(reverse("`using'"),1,4) != "atd.") local using "`using'.dta" // from spmap to check for extension
Expand Down Expand Up @@ -274,7 +274,7 @@ qui {
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' ///
`polygon' `line' `point' `label' ///
legend(off) ///
name(_map, replace) nodraw

Expand Down Expand Up @@ -404,7 +404,7 @@ qui {
foreach x of local xlvl {
foreach y of local ylvl {

if (`x'==3 & `y'==3) { // | (`x'==3 & `y'==2) | (`x'==2 & `y'==3)
if (`x'==3 & `y'==3) {
local boxes `boxes' (scatter y x if x==`x' & y==`y', mlab("`marksym'") mlabpos(0) mlabc(gs13) msymbol(square) msize(`boxsize') mc("`color`x'`y''")) ///

}
Expand All @@ -431,8 +431,8 @@ qui {
`boxes' ///
(pcarrow spike1_y1 spike1_x1 spike1_y2 spike1_x2, lcolor(gs6) mcolor(gs6) msize(0.8) ) ///
(pcarrow spike2_y1 spike2_x1 spike2_y2 spike2_x2, lcolor(gs6) mcolor(gs6) msize(0.8) ) ///
(scatter laby labx in 1, mcolor(none) mlab(labn) mlabsize(`textsize') mlabpos(6)) ///
(scatter laby labx in 2, mcolor(none) mlab(labn) mlabsize(`textsize') mlabpos(9) mlabgap(3.5) mlabangle(90)) ///
(scatter laby labx in 1, mcolor(none) mlab(labn) mlabsize(`textsize') mlabpos(6) mlabgap(`textgap') ) ///
(scatter laby labx in 2, mcolor(none) mlab(labn) mlabsize(`textsize') mlabpos(9) mlabgap(`textgap') mlabangle(90)) ///
`xvals' ///
`yvals' ///
, ///
Expand Down
6 changes: 3 additions & 3 deletions installation/bimap.pkg
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
v 1.32
v 1.33
d {bf:BIMAP}: Bi-variate maps
d
d
Expand All @@ -8,9 +8,9 @@ d KW: Stata
d KW: graphs
d KW: map
d KW: bivariate map
d Distribution-Date: 20220819
d Distribution-Date: 20220929
d
d This version: 19 Aug 2022
d This version: 29 Sep 2022
d First version: 08 Apr 2022
d License: MIT
d
Expand Down
27 changes: 15 additions & 12 deletions installation/bimap.sthlp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{smcl}
{* 19Aug2022}{...}
{* 29Dep2022}{...}
{hi:help bimap}{...}
{right:{browse "https://github.com/asjadnaqvi/stata-bimap":bimap v1.32 (GitHub)}}
{right:{browse "https://github.com/asjadnaqvi/stata-bimap":bimap v1.33 (GitHub)}}

{hline}

Expand All @@ -18,7 +18,7 @@ The {cmd:bimap} command is a wrapper for {stata help spmap:spmap}. Therefore it
{cmd:bimap} {it:vary varx} {ifin}, {cmd:cut}({it:option}) {cmd:palette}({it:option})
{cmd:[} {cmd:count} {cmd:percent} {cmd:values} {cmd:ocolor}({it:str}) {cmd:osize}({it:str}) {cmd:ndocolor}({it:str}) {cmd:ndfcolor}({it:str})
{cmd:polygon}({it:options}) {cmd:line}({it:options}) {cmd:point}({it:options}) {cmd:label}({it:options})
{cmd:textx}({it:string}) {cmd:texty}({it:str}) {cmdab:textlabs:ize}({it:num}) {cmdab:texts:ize}({it:num}) {cmdab:box:size}({it:num}) {cmd:xscale}({it:num}) {cmd:yscale}({it:num})
{cmd:textx}({it:string}) {cmd:texty}({it:str}) {cmdab:textg:ap}({it:num}) {cmdab:textlabs:ize}({it:num}) {cmdab:texts:ize}({it:num}) {cmdab:box:size}({it:num}) {cmd:xscale}({it:num}) {cmd:yscale}({it:num})
{cmd:title}({it:str}) {cmd:subtitle}({it:str}) {cmd:note}({it:str}) {cmd:name}({it:str}) {cmd:scheme}({it:str}) {cmd:]}


Expand Down Expand Up @@ -57,19 +57,22 @@ OR {ul:{it:equal}} for equal intervals. These cutoff values can be displayed usi

{p2coldent : {opt values}}Display the cut off values in the bi-variate map legend.{p_end}

{p2coldent : {opt texty(string)}}The label of legend variable on the y-axis. The default value is the variable name of {textit:vary}.{p_end}
{p2coldent : {opt texty(str)}}The label of legend variable on the y-axis. The default value is the variable name of {textit:vary}.{p_end}

{p2coldent : {opt textx(string)}}The label of legend variable on the x-axis. The default value is the variable name of {textit:varx}.{p_end}
{p2coldent : {opt textx(str)}}The label of legend variable on the x-axis. The default value is the variable name of {textit:varx}.{p_end}

{p2coldent : {opt texts:ize(string)}}The text size of the legend axis labels. The default value is 2.5.{p_end}
{p2coldent : {opt textg:ap(num)}}The gap of the axes labels from the lines. The default value is {it:2}.{p_end}

{p2coldent : {opt textlabs:ize(string)}}The text size of the cut-off values. The default value is 2.{p_end}
{p2coldent : {opt texts:ize(str)}}The text size of the legend axis labels. The default value is {it:2.5}.{p_end}

{p2coldent : {opt boxs:ize(num)}}Size of the square grids in the legend. Default value is 8. This is an advanced option and use it with caution.{p_end}
{p2coldent : {opt textlabs:ize(str)}}The text size of the cut-off values. The default value is {it:2}.{p_end}

{p2coldent : {opt xscale(num)}}The scale of the legend on the x-axis. Default value is 30. This is an advanced option and use it with caution. This option also requires adjusting the {cmd:boxsize}.{p_end}
{p2coldent : {opt boxs:ize(num)}}Size of the square grids in the legend. Default value is {it:8}. This is an advanced option and use it with caution.{p_end}

{p2coldent : {opt yscale(num)}}The scale of the legend on the y-axis. Default value is 100. This is an advanced option and use it with caution. This option also requires adjusting the {cmd:boxsize}.
{p2coldent : {opt xscale(num)}}The scale of the legend on the x-axis. Default value is {it:30}. This is an advanced option so use it with caution. This option also requires adjusting the {cmd:boxsize}.
Ideally don't touch this.{p_end}

{p2coldent : {opt yscale(num)}}The scale of the legend on the y-axis. Default value is {it:100}. This is an advanced option so use it with caution. This option also requires adjusting the {cmd:boxsize}.
Ideally don't touch this.{p_end}

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

{title:Package details}

Version : {bf:bimap} v1.32
This release : 19 Aug 2022
Version : {bf:bimap} v1.33
This release : 29 Sep 2022
First release: 08 Apr 2022
Repository : {browse "https://github.com/asjadnaqvi/stata-bimap":GitHub}
Keywords : Stata, graph, bi-variate, map
Expand Down
6 changes: 3 additions & 3 deletions installation/stata.toc
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
v 1.32
v 1.33
d BIMAP: A package for creating bivariate maps.
d
d Asjad Naqvi,
d WU Vienna/IIASA, Austria
d Asjad Naqvi
d
d [email protected]
d https://medium.com/the-stata-guide
d https://github.com/asjadnaqvi/Stata-schemes
p bimap

0 comments on commit 7bf5e35

Please sign in to comment.