From ee6dbb9ac782191f9f1449203219bc4fd9a3f39b Mon Sep 17 00:00:00 2001 From: Robin Deits Date: Wed, 13 Dec 2017 18:55:48 -0500 Subject: [PATCH] add line_z and marker_z example --- src/examples.jl | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/examples.jl b/src/examples.jl index e43fa6fe..ce527014 100644 --- a/src/examples.jl +++ b/src/examples.jl @@ -416,6 +416,22 @@ attribute. The default framestyle is `:axes`. end)] ), +PlotExample("Lines and markers with varying colors", +""" +You can use the `line_z` and `marker_z` properties to associate a color with +each line segment or marker in the plot. +""" + [:(begin + t = linspace(0, 1, 100) + θ = 6π .* t + x = t .* cos.(θ) + y = t .* sin.(θ) + p1 = plot(x, y, line_z=t, linewidth=3, legend=false) + p2 = scatter(x, y, marker_z=t, color=:bluesreds, legend=false) + plot(p1, p2) + end)] +), + ] # ---------------------------------------------------------------------------------