commit
d0b939da4a
@ -222,17 +222,6 @@ function fix_xy_lengths!(plt::Plot{PyPlotBackend}, series::Series)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# total hack due to PyPlot bug (see issue #145).
|
|
||||||
# hack: duplicate the color vector when the total rgba fields is the same as the series length
|
|
||||||
function py_color_fix(c, x)
|
|
||||||
if (typeof(c) <: AbstractArray && length(c)*4 == length(x)) ||
|
|
||||||
(typeof(c) <: Tuple && length(x) == 4)
|
|
||||||
vcat(c, c)
|
|
||||||
else
|
|
||||||
c
|
|
||||||
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])
|
||||||
py_markerstrokecolor(series::Series) = py_color(series[:markerstrokecolor])
|
py_markerstrokecolor(series::Series) = py_color(series[:markerstrokecolor])
|
||||||
@ -497,7 +486,13 @@ function py_add_series(plt::Plot{PyPlotBackend}, series::Series)
|
|||||||
else
|
else
|
||||||
py_color(plot_color(series[:markercolor], series[:markeralpha]))
|
py_color(plot_color(series[:markercolor], series[:markeralpha]))
|
||||||
end
|
end
|
||||||
extrakw[:c] = py_color_fix(markercolor, x)
|
extrakw[:c] = if markercolor isa Array
|
||||||
|
permutedims(hcat([[m...] for m in markercolor]...),[2,1])
|
||||||
|
elseif markercolor isa Tuple
|
||||||
|
reshape([markercolor...], 1, length(markercolor))
|
||||||
|
else
|
||||||
|
error("This case is not handled. Please file an issue.")
|
||||||
|
end
|
||||||
xyargs = if st == :bar && !isvertical(series)
|
xyargs = if st == :bar && !isvertical(series)
|
||||||
(y, x)
|
(y, x)
|
||||||
else
|
else
|
||||||
@ -505,7 +500,7 @@ function py_add_series(plt::Plot{PyPlotBackend}, series::Series)
|
|||||||
end
|
end
|
||||||
|
|
||||||
if isa(series[:markershape], AbstractVector{Shape})
|
if isa(series[:markershape], AbstractVector{Shape})
|
||||||
# this section will create one scatter per data point to accomodate the
|
# this section will create one scatter per data point to accommodate the
|
||||||
# vector of shapes
|
# vector of shapes
|
||||||
handle = []
|
handle = []
|
||||||
x,y = xyargs
|
x,y = xyargs
|
||||||
@ -789,7 +784,7 @@ function py_set_ticks(ax, ticks, letter)
|
|||||||
if ticks == :none || ticks == nothing || ticks == false
|
if ticks == :none || ticks == nothing || ticks == false
|
||||||
kw = KW()
|
kw = KW()
|
||||||
for dir in (:top,:bottom,:left,:right)
|
for dir in (:top,:bottom,:left,:right)
|
||||||
kw[dir] = kw[Symbol(:label,dir)] = "off"
|
kw[dir] = kw[Symbol(:label,dir)] = false
|
||||||
end
|
end
|
||||||
axis[:set_tick_params](;which="both", kw...)
|
axis[:set_tick_params](;which="both", kw...)
|
||||||
return
|
return
|
||||||
@ -1052,7 +1047,7 @@ function _before_layout_calcs(plt::Plot{PyPlotBackend})
|
|||||||
else
|
else
|
||||||
ax[:spines][string(dir)][:set_visible](false)
|
ax[:spines][string(dir)][:set_visible](false)
|
||||||
end
|
end
|
||||||
kw[dir] = kw[Symbol(:label,dir)] = "off"
|
kw[dir] = kw[Symbol(:label,dir)] = false
|
||||||
end
|
end
|
||||||
ax[:xaxis][:set_tick_params](; which="both", kw...)
|
ax[:xaxis][:set_tick_params](; which="both", kw...)
|
||||||
end
|
end
|
||||||
@ -1062,7 +1057,7 @@ function _before_layout_calcs(plt::Plot{PyPlotBackend})
|
|||||||
if !ispolar(sp)
|
if !ispolar(sp)
|
||||||
ax[:spines][string(dir)][:set_visible](false)
|
ax[:spines][string(dir)][:set_visible](false)
|
||||||
end
|
end
|
||||||
kw[dir] = kw[Symbol(:label,dir)] = "off"
|
kw[dir] = kw[Symbol(:label,dir)] = false
|
||||||
end
|
end
|
||||||
ax[:yaxis][:set_tick_params](; which="both", kw...)
|
ax[:yaxis][:set_tick_params](; which="both", kw...)
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user