| Package | Github Stars | 2-week change | Type |
|---|---|---|---|
| Gadfly | 732 | 14 | Plotting |
| IJulia | 732 | 11 | Workflow |
| Mocha | 496 | 36 | Learning |
| DataFrames | 230 | 12 | Data Structures |
| PyCall | 204 | 4 | Language Wrapper |
| JuMP | 182 | 5 | Optimization |
| Escher | 135 | 10 | GUIs |
| Optim | 131 | 4 | Optimization |
| Morsel | 128 | -1 | Web (deprecated) |
| Distributions | 125 | 7 | Statistics |
Gadfly, PyPlot, Vega, Winston, UnicodePlots, Qwt, Bokeh, Immerse, GLPlot ...
In [52]:
type ScaryVec <: AbstractArray{Int,1}
boo::Int
n::Int
ScaryVec(n::Integer) = new(rand(1:n), n)
end
Base.size(sv::ScaryVec) = (sv.n,)
Base.getindex(sv::ScaryVec, i::Integer) = (i == sv.boo ? "BOO!" : i)
sv = ScaryVec(5)
Out[52]:
In [53]:
filter(x -> isa(x, Number), sv)
Out[53]:
map, for x in ..., filter, ...)
In [5]:
# setup... choose Gadfly as the backend, set some session defaults
using Plots
gadfly()
default(size=(600,500), legend=false)
# create parametric functions
fx(u) = 1.6sin(u)^3
fy(u) = 0.3 + 1.5cos(u) - 0.6cos(2u) - 0.25cos(3u) - cos(4u)/8
# plot and annotate
p = plot(fx, fy, 0, 2π, line=(5,:darkred), xlim=(-2,2), ylim=(-2,2))
annotate!(0, 0.25, text(" I ♡\nPlots", 45, -0.1π, :darkred));
In [2]:
p
Out[2]:
In [3]:
# use the same parametric functions to create a custom marker shape
us = linspace(0, 2π, 100)
heart = Shape([(fx(u), fy(u)) for u in us])
# generate some data
n = 50
xy() = 4rand(2) - 2
# add a title
title!("Let me count the ways...")
# add a new series
scatter!(1, z=1:n, marker=(heart,15,:reds))
# animations!
anim = Animation()
for i in 1:n
x, y = xy()
# add to a series after creation
push!(p, 2, x, y)
# easy annotations
annotate!(x, y, text(i))
# save an animation frame
frame(anim)
end
In [4]:
gif(anim, "iheartplots.gif", fps=3)
Out[4]: