Merge pull request #2017 from daschw/recipe

fix recipe error
This commit is contained in:
Daniel Schwabeneder 2019-05-02 16:13:47 +02:00 committed by GitHub
commit 3542785021
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 10 deletions

View File

@ -1139,7 +1139,7 @@ function gr_display(sp::Subplot{GRBackend}, w, h, viewport_canvas)
end
if st in (:path, :scatter, :straightline)
if length(x) > 1
if x != nothing && length(x) > 1
lz = series[:line_z]
segments = iter_segments(series)
# do area fill

View File

@ -216,6 +216,7 @@ end
# ---------------------------------------------------------------------------
function fix_xy_lengths!(plt::Plot{PyPlotBackend}, series::Series)
if series[:x] != nothing
x, y = series[:x], series[:y]
nx, ny = length(x), length(y)
if !isa(get(series.plotattributes, :z, nothing), Surface) && nx != ny
@ -225,6 +226,7 @@ function fix_xy_lengths!(plt::Plot{PyPlotBackend}, series::Series)
series[:y] = Float64[y[mod1(i,ny)] for i=1:nx]
end
end
end
end
py_linecolor(series::Series) = py_color(series[:linecolor])

View File

@ -194,7 +194,9 @@ end
function iter_segments(series::Series)
x, y, z = series[:x], series[:y], series[:z]
if has_attribute_segments(series)
if x == nothing
return UnitRange{Int}[]
elseif has_attribute_segments(series)
if series[:seriestype] in (:scatter, :scatter3d)
return [[i] for i in 1:length(y)]
else