fix example

This commit is contained in:
Michael Krabbe Borregaard 2018-10-30 12:15:07 +01:00
parent 85b83e1745
commit 5e06e0d2d2
2 changed files with 2 additions and 2 deletions

View File

@ -444,7 +444,7 @@ see: http://stackoverflow.com/a/37732384/5075246
N = 10 N = 10
D = length(tickers) D = length(tickers)
weights = rand(N,D) weights = rand(N,D)
weights ./= sum(weights, 2) weights ./= sum(weights, dims = 2)
returns = sort!((1:N) + D*randn(N)) returns = sort!((1:N) + D*randn(N))
portfoliocomposition(weights, returns, labels = permutedims(tickers)) portfoliocomposition(weights, returns, labels = permutedims(tickers))

View File

@ -1143,7 +1143,7 @@ end
@recipe function f(pc::PortfolioComposition) @recipe function f(pc::PortfolioComposition)
weights, returns = pc.args weights, returns = pc.args
n = length(returns) n = length(returns)
weights = cumsum(weights,2) weights = cumsum(weights, dims = 2)
seriestype := :shape seriestype := :shape
# create a filled polygon for each item # create a filled polygon for each item