support both MPL 3.3 and 3.4

This commit is contained in:
Daniel Schwabeneder 2021-03-29 00:21:15 +02:00
parent bea1378ff1
commit 7d22d84595

View File

@ -839,10 +839,20 @@ function py_set_scale(ax, sp::Subplot, axis::Axis)
py_set_scale(ax, sp, scale, letter) py_set_scale(ax, sp, scale, letter)
end end
function py_set_axis_colors(sp, ax, a::Axis) function py_set_spine_color(spines, color)
for loc in ax.spines for loc in spines
ax.spines[loc]."set_color"(py_color(a[:foreground_color_border])) spines[loc]."set_color"(color)
end end
end
function py_set_spine_color(spines::Dict, color)
for (loc, spine) in spines
spine."set_color"(color)
end
end
function py_set_axis_colors(sp, ax, a::Axis)
py_set_spine_color(ax.spines, py_color(a[:foreground_color_border]))
axissym = Symbol(a[:letter], :axis) axissym = Symbol(a[:letter], :axis)
if PyPlot.PyCall.hasproperty(ax, axissym) if PyPlot.PyCall.hasproperty(ax, axissym)
tickcolor = sp[:framestyle] in (:zerolines, :grid) ? py_color(plot_color(a[:foreground_color_grid], a[:gridalpha])) : py_color(a[:foreground_color_axis]) tickcolor = sp[:framestyle] in (:zerolines, :grid) ? py_color(plot_color(a[:foreground_color_grid], a[:gridalpha])) : py_color(a[:foreground_color_axis])