implement showaxis for pyplot

This commit is contained in:
Daniel Schwabeneder 2017-09-29 20:16:27 +02:00
parent 6d53594850
commit 148ad8032f

View File

@ -1077,6 +1077,24 @@ function _before_layout_calcs(plt::Plot{PyPlotBackend})
py_set_axis_colors(sp, ax, axis)
end
# showaxis
if !sp[:xaxis][:showaxis]
kw = KW()
for dir in (:top, :bottom)
ax[:spines][string(dir)][:set_visible](false)
kw[dir] = kw[Symbol(:label,dir)] = "off"
end
ax[:xaxis][:set_tick_params](; which="both", kw...)
end
if !sp[:yaxis][:showaxis]
kw = KW()
for dir in (:left, :right)
ax[:spines][string(dir)][:set_visible](false)
kw[dir] = kw[Symbol(:label,dir)] = "off"
end
ax[:yaxis][:set_tick_params](; which="both", kw...)
end
# aspect ratio
aratio = sp[:aspect_ratio]
if aratio != :none