From b4846bd5d55202bb6948fb3979f69705d2ef552f Mon Sep 17 00:00:00 2001 From: Michael Cawte Date: Thu, 6 Apr 2017 11:58:50 +1200 Subject: [PATCH] Added an animation with subplots example --- src/examples.jl | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/examples.jl b/src/examples.jl index 96872851..9f54509d 100644 --- a/src/examples.jl +++ b/src/examples.jl @@ -172,6 +172,24 @@ PlotExample("", end)] ), +PlotExample("Animation with subplots", + "The `layout` macro can be used to create an animation with subplots.", + [:(begin + l = @layout([[a; b] c]) + p = plot(plot([sin,cos],1,leg=false), + scatter([atan,cos],1,leg=false), + plot(log,1,xlims=(1,10π),ylims=(0,5),leg=false),layout=l) + + anim = Animation() + for x = linspace(1,10π,100) + plot(push!(p,x,Float64[sin(x),cos(x),atan(x),cos(x),log(x)])) + frame(anim) + end + end)] +), + + + PlotExample("Open/High/Low/Close", "Create an OHLC chart. Pass in a list of (open,high,low,close) tuples as your `y` argument. This uses recipes to first convert the tuples to OHLC objects, and subsequently create a :path series with the appropriate line segments.", [:(begin