shape_coords fixes; makekw

This commit is contained in:
Tom Breloff 2016-11-17 13:45:49 -05:00
parent dd7462bd3f
commit e24acece49
5 changed files with 8 additions and 6 deletions

View File

@ -270,7 +270,7 @@ end
# draw ONE Shape
function gr_draw_marker(xi, yi, msize, shape::Shape)
sx, sy = shape_coords(shape)
sx, sy = coords(shape)
# convert to ndc coords (percentages of window)
GR.selntran(0)
xi, yi = GR.wctondc(xi, yi)

View File

@ -375,7 +375,7 @@ function plotly_close_shapes(x, y)
xs, ys = nansplit(x), nansplit(y)
for i=1:length(xs)
shape = Shape(xs[i], ys[i])
xs[i], ys[i] = shape_coords(shape)
xs[i], ys[i] = coords(shape)
end
nanvcat(xs), nanvcat(ys)
end

View File

@ -142,7 +142,7 @@ function py_linestyle(seriestype::Symbol, linestyle::Symbol)
end
function py_marker(marker::Shape)
x, y = shape_coords(marker)
x, y = coords(marker)
n = length(x)
mat = zeros(n+1,2)
for i=1:n

View File

@ -322,18 +322,18 @@ end
@recipe function f(shape::Shape)
seriestype --> :shape
shape_coords(shape)
coords(shape)
end
@recipe function f(shapes::AVec{Shape})
seriestype --> :shape
shape_coords(shapes)
coords(shapes)
end
@recipe function f(shapes::AMat{Shape})
seriestype --> :shape
for j in 1:size(shapes,2)
@series shape_coords(vec(shapes[:,j]))
@series coords(vec(shapes[:,j]))
end
end

View File

@ -493,6 +493,8 @@ zlims(sp_idx::Int = 1) = zlims(current(), sp_idx)
# ---------------------------------------------------------------
makekw(; kw...) = KW(kw)
wraptuple(x::Tuple) = x
wraptuple(x) = (x,)