From 148ad8032f57f62b1b6f6bd2f63ae4a3bf806f0b Mon Sep 17 00:00:00 2001 From: Daniel Schwabeneder Date: Fri, 29 Sep 2017 20:16:27 +0200 Subject: [PATCH] implement showaxis for pyplot --- src/backends/pyplot.jl | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/backends/pyplot.jl b/src/backends/pyplot.jl index ea0ba6c7..d2146d68 100644 --- a/src/backends/pyplot.jl +++ b/src/backends/pyplot.jl @@ -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