Merge pull request #1308 from rdeits/line-z-example

add line_z and marker_z example
This commit is contained in:
Michael Krabbe Borregaard 2017-12-14 22:05:30 +01:00 committed by GitHub
commit e11c91ddd9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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