JuliaPlots/PlotRecipes.jl

Name: PlotRecipes.jl

Owner: JuliaPlots

Description: Assorted recipes to be used with Plots.jl

Created: 2016-05-07 18:24:03.0

Updated: 2017-12-26 19:53:26.0

Pushed: 2017-10-26 13:31:50.0

Homepage: null

Size: 104

Language: Julia

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

PlotRecipes

Build Status

Primary author: Thomas Breloff (@tbreloff)

This repo maintains a collection of recipes for machine learning, graph analysis, finance, and more. It uses the powerful machinery of Plots and RecipesBase to turn simple transformations into flexible visualizations.

PlotRecipes also exports the recipes in StatPlots.jl, which is a collection of statistics recipes, including functionality for DataFrames and Distributions.


Examples


Graphs
Spectral
g PlotRecipes
15
Float64[(rand()<0.5 ? 0 : rand()) for i=1:n,j=1:n]
i=1:n
A[i,1:i-1] = A[1:i-1,i]

_weights = 1:n

hplot(A,
node_weights = 1:n,
marker = (:heat, :rect),
line = (3, 0.5, :blues),
marker_z = 1:n,
names = 1:n

hplot(A,
node_weights = 1:n,
dim = 3,
line = (3, 0.5, :blues),
marker_z = 1:n

Arc and chord diagrams
g PlotRecipes

at = Symmetric(sparse(rand(0:1,8,8)));

(
graphplot(adjmat, method=:chorddiagram),
graphplot(adjmat, method=:arcdiagram, markersize=3)
)

arc and chord diagrams

Fun with algos. Visualizing a stress-driven layout algorithm


Julia code – AST
g PlotRecipes
ot(ma=0.8,lc=:white,mc=:white,size=(1000,800))
e(:dark)

 = :(
tion transform!{T}(act::Activation{:softmax,T})
val = forward!(act.input)
out = act.output.val
for i=1:act.n
    out[i] = exp(val[i])
end
s = one(T) / sum(out)
for i=1:act.n
    out[i] *= s
end
out



(code, fontsize=11, shorten=0.2, axis_buffer=0.05)


Julia Type Trees
g PlotRecipes, Learn
ot(size=(800,500))
e(:dark)
(Learnable, method=:tree)


Maps and Shapefile.jl
g PlotRecipes, Shapefile
= "https://github.com/nvkelso/natural-earth-vector/raw/master/110m_physical/"
 "ne_110m_land.shp"
`wget $dir/$fn -P /tmp/`)
= open("/tmp/$fn") do fd
read(fd, Shapefile.Handle)

(shp)


Portfolio Composition Maps
g PlotRecipes
ers = ["IBM", "Google", "Apple", "Intel"]
10
length(tickers)
hts = rand(N,D)
hts ./= sum(weights, 2)
rns = sort!((1:N) + D*randn(N))

foliocomposition(weights, returns, labels = tickers')


StatPlots.jl

corrplot
g PlotRecipes
randn(1000,4)
2] += 0.8sqrt(abs(M[:,1])) - 0.5M[:,3] + 5
3] -= 0.7M[:,1].^2 + 2

plot(M, label = ["x$i" for i=1:4])


Marginal Histograms
g PlotRecipes, Distributions
1000
rand(Gamma(2), n)
-0.5x + randn(n)

inalhist(x, y, fc=:plasma, bins=40)


AndrewsPlot

AndrewsPlots are a way to visualize structure in high-dimensional data by depicting each row of an array or table as a line that varies with the values in columns. https://en.wikipedia.org/wiki/Andrews_plot

g RDatasets, PlotRecipes
 = dataset("datasets", "iris")
iris andrewsplot(:Species, cols(1:4), legend = :topleft)

<img width=“592” alt=“Andrew's Plot” src=“https://user-images.githubusercontent.com/8429802/29936792-c3f1c2e6-8e83-11e7-8519-99888617ac8c.png”>


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.