Merge pull request #2946 from daschw/tests
reduce animation test examples size
This commit is contained in:
commit
ea25f373bd
File diff suppressed because it is too large
Load Diff
133
src/examples.jl
133
src/examples.jl
@ -9,7 +9,7 @@ end
|
|||||||
|
|
||||||
# the _examples we'll run for each
|
# the _examples we'll run for each
|
||||||
const _examples = PlotExample[
|
const _examples = PlotExample[
|
||||||
PlotExample(
|
PlotExample( # 1
|
||||||
"Lines",
|
"Lines",
|
||||||
"A simple line plot of the columns.",
|
"A simple line plot of the columns.",
|
||||||
[:(
|
[:(
|
||||||
@ -18,7 +18,7 @@ const _examples = PlotExample[
|
|||||||
end
|
end
|
||||||
)],
|
)],
|
||||||
),
|
),
|
||||||
PlotExample(
|
PlotExample( # 2
|
||||||
"Functions, adding data, and animations",
|
"Functions, adding data, and animations",
|
||||||
"""
|
"""
|
||||||
Plot multiple functions. You can also put the function first, or use the form `plot(f,
|
Plot multiple functions. You can also put the function first, or use the form `plot(f,
|
||||||
@ -30,16 +30,16 @@ const _examples = PlotExample[
|
|||||||
""",
|
""",
|
||||||
[:(
|
[:(
|
||||||
begin
|
begin
|
||||||
p = plot([sin, cos], zeros(0), leg = false)
|
p = plot([sin, cos], zeros(0), leg = false, xlims = (0, 2π), ylims = (-1, 1))
|
||||||
anim = Animation()
|
anim = Animation()
|
||||||
for x in range(0, stop = 10π, length = 100)
|
for x in range(0, stop = 2π, length = 20)
|
||||||
push!(p, x, Float64[sin(x), cos(x)])
|
push!(p, x, Float64[sin(x), cos(x)])
|
||||||
frame(anim)
|
frame(anim)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
)],
|
)],
|
||||||
),
|
),
|
||||||
PlotExample(
|
PlotExample( # 3
|
||||||
"Parametric plots",
|
"Parametric plots",
|
||||||
"Plot function pair (x(u), y(u)).",
|
"Plot function pair (x(u), y(u)).",
|
||||||
[
|
[
|
||||||
@ -58,7 +58,7 @@ const _examples = PlotExample[
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
PlotExample(
|
PlotExample( # 4
|
||||||
"Colors",
|
"Colors",
|
||||||
"""
|
"""
|
||||||
Access predefined palettes (or build your own with the `colorscheme` method).
|
Access predefined palettes (or build your own with the `colorscheme` method).
|
||||||
@ -89,7 +89,7 @@ const _examples = PlotExample[
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
PlotExample(
|
PlotExample( # 5
|
||||||
"Global",
|
"Global",
|
||||||
"""
|
"""
|
||||||
Change the guides/background/limits/ticks. Convenience args `xaxis` and `yaxis` allow
|
Change the guides/background/limits/ticks. Convenience args `xaxis` and `yaxis` allow
|
||||||
@ -121,13 +121,7 @@ const _examples = PlotExample[
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|
||||||
# PlotExample("Two-axis",
|
PlotExample( # 6
|
||||||
# "Use the `axis` arguments.",
|
|
||||||
# [
|
|
||||||
# :(plot(Vector[randn(100), randn(100)*100], axis = [:l :r], ylabel="LEFT", yrightlabel="RIGHT", xlabel="X", title="TITLE"))
|
|
||||||
# ]),
|
|
||||||
|
|
||||||
PlotExample(
|
|
||||||
"Images",
|
"Images",
|
||||||
"Plot an image. y-axis is set to flipped",
|
"Plot an image. y-axis is set to flipped",
|
||||||
[
|
[
|
||||||
@ -142,7 +136,7 @@ const _examples = PlotExample[
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
PlotExample(
|
PlotExample( # 7
|
||||||
"Arguments",
|
"Arguments",
|
||||||
"""
|
"""
|
||||||
Plot multiple series with different numbers of points. Mix arguments that apply to all
|
Plot multiple series with different numbers of points. Mix arguments that apply to all
|
||||||
@ -166,7 +160,7 @@ const _examples = PlotExample[
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
PlotExample(
|
PlotExample( # 8
|
||||||
"Build plot in pieces",
|
"Build plot in pieces",
|
||||||
"Start with a base plot...",
|
"Start with a base plot...",
|
||||||
[:(
|
[:(
|
||||||
@ -175,7 +169,7 @@ const _examples = PlotExample[
|
|||||||
end
|
end
|
||||||
)],
|
)],
|
||||||
),
|
),
|
||||||
PlotExample(
|
PlotExample( # 9
|
||||||
"",
|
"",
|
||||||
"and add to it later.",
|
"and add to it later.",
|
||||||
[:(
|
[:(
|
||||||
@ -184,7 +178,7 @@ const _examples = PlotExample[
|
|||||||
end
|
end
|
||||||
)],
|
)],
|
||||||
),
|
),
|
||||||
PlotExample(
|
PlotExample( # 10
|
||||||
"Histogram2D",
|
"Histogram2D",
|
||||||
"",
|
"",
|
||||||
[:(
|
[:(
|
||||||
@ -193,7 +187,7 @@ const _examples = PlotExample[
|
|||||||
end
|
end
|
||||||
)],
|
)],
|
||||||
),
|
),
|
||||||
PlotExample(
|
PlotExample( # 11
|
||||||
"Line types",
|
"Line types",
|
||||||
"",
|
"",
|
||||||
[
|
[
|
||||||
@ -214,7 +208,7 @@ const _examples = PlotExample[
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
PlotExample(
|
PlotExample( # 12
|
||||||
"Line styles",
|
"Line styles",
|
||||||
"",
|
"",
|
||||||
[
|
[
|
||||||
@ -237,7 +231,7 @@ const _examples = PlotExample[
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
PlotExample(
|
PlotExample( # 13
|
||||||
"Marker types",
|
"Marker types",
|
||||||
"",
|
"",
|
||||||
[
|
[
|
||||||
@ -264,7 +258,7 @@ const _examples = PlotExample[
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
PlotExample(
|
PlotExample( # 14
|
||||||
"Bar",
|
"Bar",
|
||||||
"`x` is the midpoint of the bar. (todo: allow passing of edges instead of midpoints)",
|
"`x` is the midpoint of the bar. (todo: allow passing of edges instead of midpoints)",
|
||||||
[:(
|
[:(
|
||||||
@ -273,7 +267,7 @@ const _examples = PlotExample[
|
|||||||
end
|
end
|
||||||
)],
|
)],
|
||||||
),
|
),
|
||||||
PlotExample(
|
PlotExample( # 15
|
||||||
"Histogram",
|
"Histogram",
|
||||||
"",
|
"",
|
||||||
[
|
[
|
||||||
@ -288,7 +282,7 @@ const _examples = PlotExample[
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
PlotExample(
|
PlotExample( # 16
|
||||||
"Subplots",
|
"Subplots",
|
||||||
"""
|
"""
|
||||||
Use the `layout` keyword, and optionally the convenient `@layout` macro to generate
|
Use the `layout` keyword, and optionally the convenient `@layout` macro to generate
|
||||||
@ -310,7 +304,7 @@ const _examples = PlotExample[
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
PlotExample(
|
PlotExample( # 17
|
||||||
"Adding to subplots",
|
"Adding to subplots",
|
||||||
"""
|
"""
|
||||||
Note here the automatic grid layout, as well as the order in which new series are added
|
Note here the automatic grid layout, as well as the order in which new series are added
|
||||||
@ -329,14 +323,20 @@ const _examples = PlotExample[
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
PlotExample("", "", [:(
|
PlotExample( # 18
|
||||||
begin
|
"",
|
||||||
using Random
|
"",
|
||||||
Random.seed!(111)
|
[
|
||||||
plot!(Plots.fakedata(100, 10))
|
:(
|
||||||
end
|
begin
|
||||||
)]),
|
using Random
|
||||||
PlotExample(
|
Random.seed!(111)
|
||||||
|
plot!(Plots.fakedata(100, 10))
|
||||||
|
end
|
||||||
|
)
|
||||||
|
]
|
||||||
|
),
|
||||||
|
PlotExample( # 19
|
||||||
"Open/High/Low/Close",
|
"Open/High/Low/Close",
|
||||||
"""
|
"""
|
||||||
Create an OHLC chart. Pass in a list of (open,high,low,close) tuples as your `y`
|
Create an OHLC chart. Pass in a list of (open,high,low,close) tuples as your `y`
|
||||||
@ -365,7 +365,7 @@ const _examples = PlotExample[
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
PlotExample(
|
PlotExample( # 20
|
||||||
"Annotations",
|
"Annotations",
|
||||||
"""
|
"""
|
||||||
The `annotations` keyword is used for text annotations in data-coordinates. Pass in a
|
The `annotations` keyword is used for text annotations in data-coordinates. Pass in a
|
||||||
@ -408,7 +408,7 @@ const _examples = PlotExample[
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
PlotExample(
|
PlotExample( # 21
|
||||||
"Custom Markers",
|
"Custom Markers",
|
||||||
"""A `Plots.Shape` is a light wrapper around vertices of a polygon. For supported
|
"""A `Plots.Shape` is a light wrapper around vertices of a polygon. For supported
|
||||||
backends, pass arbitrary polygons as the marker shapes. Note: The center is (0,0) and
|
backends, pass arbitrary polygons as the marker shapes. Note: The center is (0,0) and
|
||||||
@ -454,7 +454,7 @@ const _examples = PlotExample[
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
PlotExample(
|
PlotExample( # 22
|
||||||
"Contours",
|
"Contours",
|
||||||
"""
|
"""
|
||||||
Any value for fill works here. We first build a filled contour from a function, then an
|
Any value for fill works here. We first build a filled contour from a function, then an
|
||||||
@ -474,7 +474,7 @@ const _examples = PlotExample[
|
|||||||
end
|
end
|
||||||
)],
|
)],
|
||||||
),
|
),
|
||||||
PlotExample(
|
PlotExample( # 23
|
||||||
"Pie",
|
"Pie",
|
||||||
"",
|
"",
|
||||||
[:(
|
[:(
|
||||||
@ -485,7 +485,7 @@ const _examples = PlotExample[
|
|||||||
end
|
end
|
||||||
)],
|
)],
|
||||||
),
|
),
|
||||||
PlotExample(
|
PlotExample( # 24
|
||||||
"3D",
|
"3D",
|
||||||
"",
|
"",
|
||||||
[
|
[
|
||||||
@ -511,7 +511,7 @@ const _examples = PlotExample[
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
PlotExample(
|
PlotExample( # 25
|
||||||
"DataFrames",
|
"DataFrames",
|
||||||
"Plot using DataFrame column symbols.",
|
"Plot using DataFrame column symbols.",
|
||||||
[
|
[
|
||||||
@ -534,7 +534,7 @@ const _examples = PlotExample[
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
PlotExample(
|
PlotExample( # 26
|
||||||
"Groups and Subplots",
|
"Groups and Subplots",
|
||||||
"",
|
"",
|
||||||
[
|
[
|
||||||
@ -552,7 +552,7 @@ const _examples = PlotExample[
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
PlotExample(
|
PlotExample( # 27
|
||||||
"Polar Plots",
|
"Polar Plots",
|
||||||
"",
|
"",
|
||||||
[:(
|
[:(
|
||||||
@ -563,7 +563,7 @@ const _examples = PlotExample[
|
|||||||
end
|
end
|
||||||
)],
|
)],
|
||||||
),
|
),
|
||||||
PlotExample(
|
PlotExample( # 28
|
||||||
"Heatmap, categorical axes, and aspect_ratio",
|
"Heatmap, categorical axes, and aspect_ratio",
|
||||||
"",
|
"",
|
||||||
[:(
|
[:(
|
||||||
@ -575,7 +575,7 @@ const _examples = PlotExample[
|
|||||||
end
|
end
|
||||||
)],
|
)],
|
||||||
),
|
),
|
||||||
PlotExample(
|
PlotExample( # 29
|
||||||
"Layouts, margins, label rotation, title location",
|
"Layouts, margins, label rotation, title location",
|
||||||
"",
|
"",
|
||||||
[
|
[
|
||||||
@ -595,7 +595,7 @@ const _examples = PlotExample[
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
PlotExample(
|
PlotExample( # 30
|
||||||
"Boxplot and Violin series recipes",
|
"Boxplot and Violin series recipes",
|
||||||
"",
|
"",
|
||||||
[
|
[
|
||||||
@ -620,7 +620,7 @@ const _examples = PlotExample[
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
PlotExample(
|
PlotExample( # 31
|
||||||
"Animation with subplots",
|
"Animation with subplots",
|
||||||
"The `layout` macro can be used to create an animation with subplots.",
|
"The `layout` macro can be used to create an animation with subplots.",
|
||||||
[
|
[
|
||||||
@ -628,14 +628,15 @@ const _examples = PlotExample[
|
|||||||
begin
|
begin
|
||||||
l = @layout([[a; b] c])
|
l = @layout([[a; b] c])
|
||||||
p = plot(
|
p = plot(
|
||||||
plot([sin, cos], 1, leg = false),
|
plot([sin, cos], 1, ylims = (-1, 1), leg = false),
|
||||||
scatter([atan, cos], 1, leg = false),
|
scatter([atan, cos], 1, ylims = (-1, 1.5), leg = false),
|
||||||
plot(log, 1, xlims = (1, 10π), ylims = (0, 5), leg = false),
|
plot(log, 1, ylims = (0, 2), leg = false),
|
||||||
layout = l,
|
layout = l,
|
||||||
|
xlims = (1, 2π),
|
||||||
)
|
)
|
||||||
|
|
||||||
anim = Animation()
|
anim = Animation()
|
||||||
for x in range(1, stop = 10π, length = 100)
|
for x in range(1, stop = 2π, length = 20)
|
||||||
plot(push!(
|
plot(push!(
|
||||||
p,
|
p,
|
||||||
x,
|
x,
|
||||||
@ -647,7 +648,7 @@ const _examples = PlotExample[
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
PlotExample(
|
PlotExample( # 32
|
||||||
"Spy",
|
"Spy",
|
||||||
"""
|
"""
|
||||||
For a matrix `mat` with unique nonzeros `spy(mat)` returns a colorless plot. If `mat` has
|
For a matrix `mat` with unique nonzeros `spy(mat)` returns a colorless plot. If `mat` has
|
||||||
@ -681,7 +682,7 @@ const _examples = PlotExample[
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
PlotExample(
|
PlotExample( # 33
|
||||||
"Magic grid argument",
|
"Magic grid argument",
|
||||||
"""
|
"""
|
||||||
The grid lines can be modified individually for each axis with the magic `grid` argument.
|
The grid lines can be modified individually for each axis with the magic `grid` argument.
|
||||||
@ -711,7 +712,7 @@ const _examples = PlotExample[
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
PlotExample(
|
PlotExample( # 34
|
||||||
"Framestyle",
|
"Framestyle",
|
||||||
"""
|
"""
|
||||||
The style of the frame/axes of a (sub)plot can be changed with the `framestyle`
|
The style of the frame/axes of a (sub)plot can be changed with the `framestyle`
|
||||||
@ -735,7 +736,7 @@ const _examples = PlotExample[
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
PlotExample(
|
PlotExample( # 35
|
||||||
"Lines and markers with varying colors",
|
"Lines and markers with varying colors",
|
||||||
"""
|
"""
|
||||||
You can use the `line_z` and `marker_z` properties to associate a color with
|
You can use the `line_z` and `marker_z` properties to associate a color with
|
||||||
@ -761,7 +762,7 @@ const _examples = PlotExample[
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
PlotExample(
|
PlotExample( # 36
|
||||||
"Portfolio Composition maps",
|
"Portfolio Composition maps",
|
||||||
"""
|
"""
|
||||||
see: http://stackoverflow.com/a/37732384/5075246
|
see: http://stackoverflow.com/a/37732384/5075246
|
||||||
@ -787,7 +788,7 @@ const _examples = PlotExample[
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
PlotExample(
|
PlotExample( # 37
|
||||||
"Ribbons",
|
"Ribbons",
|
||||||
"""
|
"""
|
||||||
Ribbons can be added to lines via the `ribbon` keyword;
|
Ribbons can be added to lines via the `ribbon` keyword;
|
||||||
@ -810,7 +811,7 @@ const _examples = PlotExample[
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
PlotExample(
|
PlotExample( # 38
|
||||||
"Histogram2D (complex values)",
|
"Histogram2D (complex values)",
|
||||||
"",
|
"",
|
||||||
[
|
[
|
||||||
@ -829,7 +830,7 @@ const _examples = PlotExample[
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
PlotExample(
|
PlotExample( # 39
|
||||||
"Unconnected lines using `missing` or `NaN`",
|
"Unconnected lines using `missing` or `NaN`",
|
||||||
"""
|
"""
|
||||||
Missing values and non-finite values, including `NaN`, are not plotted.
|
Missing values and non-finite values, including `NaN`, are not plotted.
|
||||||
@ -853,7 +854,7 @@ const _examples = PlotExample[
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
PlotExample(
|
PlotExample( # 40
|
||||||
"Lens",
|
"Lens",
|
||||||
"A lens lets you easily magnify a region of a plot. x and y coordinates refer to the to be magnified region and the via the `inset` keyword the subplot index and the bounding box (in relative coordinates) of the inset plot with the magnified plot can be specified. Additional attributes count for the inset plot.",
|
"A lens lets you easily magnify a region of a plot. x and y coordinates refer to the to be magnified region and the via the `inset` keyword the subplot index and the bounding box (in relative coordinates) of the inset plot with the magnified plot can be specified. Additional attributes count for the inset plot.",
|
||||||
[
|
[
|
||||||
@ -875,7 +876,7 @@ const _examples = PlotExample[
|
|||||||
end,
|
end,
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
PlotExample(
|
PlotExample( # 41
|
||||||
"Array Types",
|
"Array Types",
|
||||||
"Plots supports different `Array` types that follow the `AbstractArray` interface, like `StaticArrays` and `OffsetArrays.`",
|
"Plots supports different `Array` types that follow the `AbstractArray` interface, like `StaticArrays` and `OffsetArrays.`",
|
||||||
[
|
[
|
||||||
@ -890,7 +891,7 @@ const _examples = PlotExample[
|
|||||||
end,
|
end,
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
PlotExample(
|
PlotExample( # 42
|
||||||
"Setting defaults and font arguments",
|
"Setting defaults and font arguments",
|
||||||
"",
|
"",
|
||||||
[
|
[
|
||||||
@ -920,7 +921,7 @@ const _examples = PlotExample[
|
|||||||
end,
|
end,
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
PlotExample(
|
PlotExample( # 43
|
||||||
"Heatmap with DateTime axis",
|
"Heatmap with DateTime axis",
|
||||||
"",
|
"",
|
||||||
[
|
[
|
||||||
@ -935,7 +936,7 @@ const _examples = PlotExample[
|
|||||||
end,
|
end,
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
PlotExample(
|
PlotExample( # 44
|
||||||
"Linked axes",
|
"Linked axes",
|
||||||
"",
|
"",
|
||||||
[
|
[
|
||||||
@ -947,7 +948,7 @@ const _examples = PlotExample[
|
|||||||
end,
|
end,
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
PlotExample(
|
PlotExample( # 45
|
||||||
"Error bars and array type recipes",
|
"Error bars and array type recipes",
|
||||||
"",
|
"",
|
||||||
[
|
[
|
||||||
@ -984,7 +985,7 @@ const _examples = PlotExample[
|
|||||||
end,
|
end,
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
PlotExample(
|
PlotExample( # 46
|
||||||
"Tuples and `Point`s as data",
|
"Tuples and `Point`s as data",
|
||||||
"",
|
"",
|
||||||
[quote
|
[quote
|
||||||
@ -995,7 +996,7 @@ const _examples = PlotExample[
|
|||||||
scatter!(Point2.(eachcol(rand(d,1000))), alpha=0.25)
|
scatter!(Point2.(eachcol(rand(d,1000))), alpha=0.25)
|
||||||
end]
|
end]
|
||||||
),
|
),
|
||||||
PlotExample(
|
PlotExample( # 47
|
||||||
"Mesh3d",
|
"Mesh3d",
|
||||||
"""
|
"""
|
||||||
Allows to plot arbitrary 3d meshes. If only x,y,z are given the mesh is generated automatically.
|
Allows to plot arbitrary 3d meshes. If only x,y,z are given the mesh is generated automatically.
|
||||||
@ -1024,7 +1025,7 @@ const _examples = PlotExample[
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
PlotExample(
|
PlotExample( # 48
|
||||||
"Vectors of markershapes and segments",
|
"Vectors of markershapes and segments",
|
||||||
"",
|
"",
|
||||||
[quote
|
[quote
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user