gr_polyline fixes
This commit is contained in:
parent
b3ac38a6f1
commit
d15fcb6b24
@ -160,17 +160,38 @@ function gr_polymarker(d, x, y)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# draw line segments, splitting x/y into contiguous/finite segments
|
||||||
function gr_polyline(x, y)
|
function gr_polyline(x, y)
|
||||||
i = j = 1
|
iend = 0
|
||||||
n = length(x)
|
n = length(x)
|
||||||
while i < n
|
while iend < n-1
|
||||||
while j < n && x[j] != NaN && y[j] != NaN
|
# set istart to the first index that is finite
|
||||||
j += 1
|
istart = -1
|
||||||
|
for j = iend+1:n
|
||||||
|
if isfinite(x[j]) && isfinite(y[j])
|
||||||
|
istart = j
|
||||||
|
break
|
||||||
end
|
end
|
||||||
if i < j
|
|
||||||
GR.polyline(x[i:j], y[i:j])
|
|
||||||
end
|
end
|
||||||
i = j + 1
|
|
||||||
|
if istart > 0
|
||||||
|
# iend is the last finite index
|
||||||
|
iend = -1
|
||||||
|
for j = istart+1:n
|
||||||
|
if isfinite(x[j]) && isfinite(y[j])
|
||||||
|
iend = j
|
||||||
|
else
|
||||||
|
break
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
# if we found a start and end, draw the line segment, otherwise we're done
|
||||||
|
if istart > 0 && iend > 0
|
||||||
|
GR.polyline(x[istart:iend], y[istart:iend])
|
||||||
|
else
|
||||||
|
break
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -181,7 +202,7 @@ end
|
|||||||
# j = 1
|
# j = 1
|
||||||
# n = length(x)
|
# n = length(x)
|
||||||
# while i < n
|
# while i < n
|
||||||
# while j < n && x[j] != Nan && y[j] != NaN
|
# while j < n && x[j] != NaN && y[j] != NaN
|
||||||
# j += 1
|
# j += 1
|
||||||
# end
|
# end
|
||||||
# if i < j
|
# if i < j
|
||||||
|
|||||||
@ -95,7 +95,7 @@ end
|
|||||||
# natively by the backend
|
# natively by the backend
|
||||||
function _apply_series_recipe(plt::Plot, d::KW)
|
function _apply_series_recipe(plt::Plot, d::KW)
|
||||||
st = d[:seriestype]
|
st = d[:seriestype]
|
||||||
@show st
|
# @show st
|
||||||
if st in supportedTypes()
|
if st in supportedTypes()
|
||||||
|
|
||||||
# getting ready to add the series... last update to subplot from anything
|
# getting ready to add the series... last update to subplot from anything
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user