fix recipe error

This commit is contained in:
Daniel Schwabeneder 2019-05-02 12:48:06 +02:00
parent e860ba220a
commit 65173e6dd2
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 end
if st in (:path, :scatter, :straightline) if st in (:path, :scatter, :straightline)
if length(x) > 1 if x != nothing && length(x) > 1
lz = series[:line_z] lz = series[:line_z]
segments = iter_segments(series) segments = iter_segments(series)
# do area fill # do area fill

View File

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

View File

@ -194,7 +194,9 @@ end
function iter_segments(series::Series) function iter_segments(series::Series)
x, y, z = series[:x], series[:y], series[:z] 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) if series[:seriestype] in (:scatter, :scatter3d)
return [[i] for i in 1:length(y)] return [[i] for i in 1:length(y)]
else else