conditionally fix pyplot

This commit is contained in:
Simon Christ 2021-05-14 19:15:30 +02:00
parent 1e08940a03
commit f48b1c93d8

View File

@ -1063,8 +1063,14 @@ function _before_layout_calcs(plt::Plot{PyPlotBackend})
ax.spines["left"]."set_position"("zero") ax.spines["left"]."set_position"("zero")
end end
elseif sp[:framestyle] in (:grid, :none, :zerolines) elseif sp[:framestyle] in (:grid, :none, :zerolines)
for spine in ax.spines if PyPlot.version >= v"3.4.1" # that is one where it worked, the API change may have some other value
ax.spines[string(spine)]."set_visible"(false) for spine in ax.spines
ax.spines[string(spine)]."set_visible"(false)
end
else
for (loc, spine) in ax.spines
spine."set_visible"(false)
end
end end
if sp[:framestyle] == :zerolines if sp[:framestyle] == :zerolines
ax."axhline"(y = 0, color = py_color(sp[:xaxis][:foreground_color_axis]), lw = py_thickness_scale(plt, 0.75)) ax."axhline"(y = 0, color = py_color(sp[:xaxis][:foreground_color_axis]), lw = py_thickness_scale(plt, 0.75))