From bea1378ff18fb01d5fac09bb71944e28c58f8ab8 Mon Sep 17 00:00:00 2001 From: Ronan Pigott Date: Sat, 27 Mar 2021 13:28:00 -0700 Subject: [PATCH 1/2] fix PyPlot spines iteration --- src/backends/pyplot.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/backends/pyplot.jl b/src/backends/pyplot.jl index aca6bb64..f2b25604 100644 --- a/src/backends/pyplot.jl +++ b/src/backends/pyplot.jl @@ -840,8 +840,8 @@ function py_set_scale(ax, sp::Subplot, axis::Axis) end function py_set_axis_colors(sp, ax, a::Axis) - for (loc, spine) in ax.spines - spine."set_color"(py_color(a[:foreground_color_border])) + for loc in ax.spines + ax.spines[loc]."set_color"(py_color(a[:foreground_color_border])) end axissym = Symbol(a[:letter], :axis) if PyPlot.PyCall.hasproperty(ax, axissym) From 7d22d84595c2bc4cd7735b8d2f7cc7403eb53889 Mon Sep 17 00:00:00 2001 From: Daniel Schwabeneder Date: Mon, 29 Mar 2021 00:21:15 +0200 Subject: [PATCH 2/2] support both MPL 3.3 and 3.4 --- src/backends/pyplot.jl | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/backends/pyplot.jl b/src/backends/pyplot.jl index f2b25604..a2c18b69 100644 --- a/src/backends/pyplot.jl +++ b/src/backends/pyplot.jl @@ -839,10 +839,20 @@ function py_set_scale(ax, sp::Subplot, axis::Axis) py_set_scale(ax, sp, scale, letter) end -function py_set_axis_colors(sp, ax, a::Axis) - for loc in ax.spines - ax.spines[loc]."set_color"(py_color(a[:foreground_color_border])) +function py_set_spine_color(spines, color) + for loc in spines + spines[loc]."set_color"(color) 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) 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])