allow negative radii in polar plots for pyplot

This commit is contained in:
Daniel Schwabeneder 2019-04-26 13:17:29 +02:00
parent b053366b06
commit a6588daa3e

View File

@ -376,6 +376,18 @@ function py_add_series(plt::Plot{PyPlotBackend}, series::Series)
elseif st == :shape
x, y = shape_data(series)
end
if ispolar(series)
# make negative radii positive and flip the angle
# (PyPlot ignores negative radii)
for i in eachindex(y)
if y[i] < 0
y[i] = -y[i]
x[i] -= π
end
end
end
xyargs = (st in _3dTypes ? (x,y,z) : (x,y))
# handle zcolor and get c/cmap