Skip to content

Commit

Permalink
v1.0 minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
asjadnaqvi committed Aug 21, 2022
1 parent c8e8b7c commit 84ce5c8
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 21 deletions.
24 changes: 6 additions & 18 deletions installation/arcplot.ado
Original file line number Diff line number Diff line change
Expand Up @@ -95,13 +95,11 @@ qui {
gen y = 0

sum valsumtotg, meanonly
gen double x = valsumtotg / `r(max)'
gen double x = valsumtotg / r(max)

// get the spikes
sort id layer x


// cap drop x1 y1 x2 y2

gen x1 = .
gen y1 = .
Expand Down Expand Up @@ -160,28 +158,26 @@ qui {
summ value if id==`x' & layer==1, meanonly
gen double fval`x' = r(mean) // from value

qui summ order if id==`x' & layer==1, meanonly
summ order if id==`x' & layer==1, meanonly
local prel1 = `r(mean)' - 1

// end future block here



replace boxx`x' = x if lab2==`labcat1' & order==`prel1'
replace boxy`x' = y if lab2==`labcat1' & order==`prel1'


*** one more item for the future. the mid point for labels on the from values

summ boxx`x' if layer==1, meanonly
gen fmid`x' = r(mean)
gen double fmid`x' = r(mean)

// layer 2


qui summ lab2 if id==`x' & layer==2, meanonly
summ lab2 if id==`x' & layer==2, meanonly
local labcat2 = r(mean)

qui summ order if id==`x' & layer==2, meanonly
summ order if id==`x' & layer==2, meanonly
local prel2 = `r(mean)' - 1

replace boxx`x' = x if lab2==`labcat2' & order==`prel2'
Expand All @@ -191,8 +187,6 @@ qui {
replace seq`x' = seq`x'[_n+1] if seq`x'[_n+1]!=.
}

**** somewhere here the observations should be an expand

expand `arcpoints' // higher the number, smoother the curve, but also slower the process

levelsof id if layer==1 & order!=0, local(lvls)
Expand Down Expand Up @@ -226,7 +220,6 @@ qui {
gen double t`x' = runiform(`end', `start')
}


gen double radius`x'_in = sqrt((`xin1' - `midx')^2 + (0 - `midy')^2) // from the center point
gen double radius`x'_out = sqrt((`xout1' - `midx')^2 + (0 - `midy')^2) // from the center point

Expand Down Expand Up @@ -272,16 +265,12 @@ qui {
sort num level arcx
gen order = _n if level==1


gsort level -arcx
gen temp = _n if level==2

replace order = temp if level==2
drop temp


*egen tag1 = tag(y1 x1 y2 x2) // for the spikes

cap drop tag2
egen tag2 = tag(num ymid xmid) // for the mid point of spikes

Expand Down Expand Up @@ -323,7 +312,6 @@ qui {
qui summ from if num==`x'
local clr `r(mean)'

*colorpalette HCL intense, n(`items') nograph
colorpalette `palette', n(`items') nograph

local arcs `arcs' (area arcy arcx if num==`x', fi(100) fc( "`r(p`clr')'%`alpha'") lw(`lwidth') lc(`lcolor')) ||
Expand Down
2 changes: 1 addition & 1 deletion installation/arcplot.pkg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
v 1.0
d {bf:ARCPLOT}: A Stata package for joy plots.
d {bf:ARCPLOT}: A Stata package for arc plots.
d See {bf:help arcplot} after installation.
d
d Requires: Stata version 15 or higher.
Expand Down
4 changes: 2 additions & 2 deletions installation/stata.toc
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
v 1.0
d 'ARCPLOT': A package for creating arc plots
d 'ARCPLOT': A Stata package for creating arc plots
d Asjad Naqvi,
d [email protected]
d https://medium.com/the-stata-guide
p joyplot
p arcplot


0 comments on commit 84ce5c8

Please sign in to comment.