Skip to content

Commit

Permalink
v1.21
Browse files Browse the repository at this point in the history
  • Loading branch information
asjadnaqvi committed Jun 10, 2023
1 parent baf89e1 commit 189b333
Show file tree
Hide file tree
Showing 7 changed files with 44 additions and 25 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 ``spider''"
version: 1.2
date-released: 2023-05-20
version: 1.21
date-released: 2023-06-10
url: "https://github.com/asjadnaqvi/stata-spider"
21 changes: 16 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

---

# spider v1.2
# spider v1.21

This package provides the ability to draw spiders Stata. It is based on the [Spider plots](https://medium.com/the-stata-guide/stata-graphs-spider-plots-613808b51f73) guide on Medium

Expand All @@ -20,7 +20,7 @@ The SSC version (**v1.1**):
ssc install spider, replace
```

Or it can be installed from GitHub (**v1.2**):
Or it can be installed from GitHub (**v1.21**):

```
net install spider, from("https://raw.githubusercontent.com/asjadnaqvi/stata-spider/main/installation/") replace
Expand Down Expand Up @@ -54,17 +54,17 @@ graph set window fontface "Arial Narrow"

## Syntax

The syntax for v1.2 is as follows:
The syntax for v1.21 is as follows:

```
spider varlist [if] [in], over(cat var)
[ alpha(num 0-100) rotate(num) smooth(num 0-1) palette(str)
range(val1 val2) cuts(num) raformat(fmt) ralabsize(str) lwidth(str) msymbol(str)
range(val1 val2) cuts(num) lwidth(str) msymbol(str)
raformat(fmt) ralabsize(str) ralabcolor(str) ralabangle(str)
msize(str) mlwidth(str) displacelab(num) displacespike(num)
ccolor(str) cwidth(str) scolor(str) swidth(str) slabsize(str)
nolegend legpositon(num) legpositon(num) legcolumns(num) legsize(num) xsize(num) ysize(num)
title(str) subtitle(str) note(str) scheme(str) name(str) ]
```

See the help file `help spider` for details.
Expand Down Expand Up @@ -231,6 +231,14 @@ spider index*, over(policy) ra(0.1 0.7) cuts(4) raformat(%5.1f) ralabs(2) smooth

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

### Range label options (v1.21)

```
spider index* if year==2021, over(policy) msym(Oh) lw(0.4) ms(0.4) ra(0 100) ralabc(blue) ralabs(2) ralaba(45)
```

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


## Feedback

Expand All @@ -239,6 +247,9 @@ Please open an [issue](https://github.com/asjadnaqvi/stata-spider/issues) to rep

## Change log

**v1.21 (10 Jun 2023)**
- Two options added for range labels: `ralabcolor()`, `ralabangle()`.

**v1.2 (20 May 2023)**
- Several legend options added (requested by Marc Kaulisch). These include `nolegend`, `legendpos()`, `legendsize()`, `legendcol()`.
- `xsize()` and `ysize()` added to allow users to control the dimensions.
Expand Down
Binary file added figures/spider11.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 11 additions & 8 deletions installation/spider.ado
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
*! spider v1.2 (20 May 2023)
*! spider v1.21 (10 June 2023)
*! Asjad Naqvi ([email protected])

* v1.2 (20 May 2023): Major fixes to the legend.
* v1.1 (22 Dec 2022): Minor fixes.
* v1.0 (13 Oct 2022): Beta release.
* v1.21 (10 Jun 2023): Options added: ralabcolor() ralabangle().
* v1.2 (20 May 2023): Major fixes to the legend.
* v1.1 (22 Dec 2022): Minor fixes.
* v1.0 (13 Oct 2022): Beta release.

**********************************
* Step-by-step guide on Medium *
Expand All @@ -25,7 +26,8 @@ version 15
[ LWidth(string) MSYMbol(string) MSize(string) MLWIDth(string) ] /// // spider properties
[ CColor(string) CWidth(string) SColor(string) SWidth(string) SLABSize(string) ] /// // circle = C, spikes = S
[ title(passthru) subtitle(passthru) note(passthru) scheme(passthru) name(passthru) ] ///
[ NOLEGend LEGPOSition(real 6) LEGCOLumns(real 5) LEGSize(real 2.2) xsize(real 1) ysize(real 1) ] // v1.2 updates.
[ NOLEGend LEGPOSition(real 6) LEGCOLumns(real 5) LEGSize(real 2.2) xsize(real 1) ysize(real 1) ] /// // v1.2 updates.
[ RALABColor(string) RALABAngle(string) ] // v1.21 options

// TODO:
// ROTATELABel: allow label rotations
Expand Down Expand Up @@ -305,16 +307,17 @@ preserve
//////////////////////

local axisr = 100 * (1.3)
if "`ralabsize'" == "" local ralabsize = 1.8

if "`ralabsize'" == "" local ralabsize = 1.8
if "`ralabcolor'" == "" local ralabcolor black
if "`ralabangle'" == "" local ralabangle 0

twoway ///
`circle' ///
`spike' ///
`spider' ///
`spider2' ///
`labs' ///
(scatter yvar xvar, mc(none) mlab(xlab) mlabpos(0) mlabsize(`ralabsize')) ///
(scatter yvar xvar, mc(none) mlab(xlab) mlabpos(0) mlabsize(`ralabsize') mlabcolor(`ralabcolor') mlabangle(`ralabangle') ) ///
, ///
aspect(1) xsize(`xsize') ysize(`ysize') ///
xlabel(-`axisr' `axisr') ///
Expand Down
6 changes: 3 additions & 3 deletions installation/spider.pkg
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
v 1.2
v 1.21
d {bf:SPIDER}: A Stata package for spider plots.
d See {bf:help spider} after installation.
d
Expand All @@ -9,9 +9,9 @@ d KW: graphs
d KW: spider plot
d
d
d Distribution-Date: 20230520
d Distribution-Date: 20230610
d
d This version: 20 May 2023
d This version: 10 Jun 2023
d First version: 13 Oct 2022
d License: MIT
d
Expand Down
15 changes: 10 additions & 5 deletions installation/spider.sthlp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{smcl}
{* 20May2023}{...}
{* 10Jun2023}{...}
{hi:help spider}{...}
{right:{browse "https://github.com/asjadnaqvi/stata-spider":spider v1.2 (GitHub)}}
{right:{browse "https://github.com/asjadnaqvi/stata-spider":spider v1.21 (GitHub)}}

{hline}

Expand All @@ -15,7 +15,8 @@ The command is based on the following guide on Medium: {browse "https://medium.c

{cmd:spider} {it:varlist} {ifin}, {cmd:over}({it:cat var})
{cmd:[} {cmd:alpha}({it:num 0-100}) {cmdab:ro:tate}({it:num}) {cmd:smooth}({it:num 0-1}) {cmd:palette}({it:str})
{cmdab:ra:nge}({it:val1 val2}) {cmd:cuts}({it:num}) {cmd:raformat}({it:fmt}) {cmdab:ralabs:ize}({it:str}) {cmdab:lw:idth}({it:str}) {cmdab:msym:bol}({it:str})
{cmdab:ra:nge}({it:val1 val2}) {cmd:cuts}({it:num}) {cmdab:lw:idth}({it:str}) {cmdab:msym:bol}({it:str})
{cmd:raformat}({it:fmt}) {cmdab:ralabs:ize}({it:str}) {cmdab:ralabc:olor}({it:str}) {cmdab:ralaba:ngle}({it:str})
{cmdab:ms:ize}({it:str}) {cmdab:mlw:idth}({it:str}) {cmdab:displacel:ab}({it:num}) {cmdab:displaces:pike}({it:num})
{cmdab:cc:olor}({it:str}) {cmdab:cw:idth}({it:str}) {cmdab:sc:olor}({it:str}) {cmdab:sw:idth}({it:str}) {cmdab:slabs:ize}({it:str})
{cmdab:noleg:end} {cmdab:legpos:iton}({it:num}) {cmdab:legpos:iton}({it:num}) {cmdab:legcol:umns}({it:num}) {cmdab:legs:ize}({it:num}) {cmd:xsize}({it:num}) {cmd:ysize}({it:num})
Expand Down Expand Up @@ -59,6 +60,10 @@ If your data ranges has decimal values, then it is advised to change the display

{p2coldent : {opt ralabs:ize(str)}}The size of the range labels. The default format is {opt ralabs(1.8)}.{p_end}

{p2coldent : {opt ralabc:olor(str)}}The color of the range labels. The default format is {opt ralabc(black)}.{p_end}

{p2coldent : {opt ralaba:ngle(str)}}The angle of the range labels. The default format is {opt ralaba(0)} for horizontal.{p_end}

{p2coldent : {opt lw:idth(num)}}The outline width of the spider area fill. Default is {opt lw(0.3)}.
Area fill lines can be turned off by defining {opt lw(none)}.{p_end}

Expand Down Expand Up @@ -122,8 +127,8 @@ See {browse "https://github.com/asjadnaqvi/stata-spider":GitHub} for examples.

{title:Package details}

Version : {bf:spider} v1.2
This release : 20 May 2023
Version : {bf:spider} v1.21
This release : 10 Jun 2023
First release: 13 Oct 2022
Repository : {browse "https://github.com/asjadnaqvi/stata-spider":GitHub}
Keywords : Stata, graph, spider plot
Expand Down
4 changes: 2 additions & 2 deletions installation/stata.toc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
v 1.2
v 1.21
d 'SPIDER': A Stata package for spider plots
d
d Distribution-Date: 20230520
d Distribution-Date: 20230610
d
d Asjad Naqvi
d [email protected]
Expand Down

0 comments on commit 189b333

Please sign in to comment.