add line_z and marker_z example

This commit is contained in:
Robin Deits 2017-12-13 18:55:48 -05:00
parent 5b85cd83f2
commit ee6dbb9ac7

View File

@ -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)]
),
]
# ---------------------------------------------------------------------------------