From 2bbd4cbb17922ad035533bdf8857ff610a288823 Mon Sep 17 00:00:00 2001 From: Daniel Schwabeneder Date: Thu, 24 Aug 2017 16:26:54 +0200 Subject: [PATCH] clean up --- src/args.jl | 2 +- src/axes.jl | 20 ++++++++++---------- src/backends/pyplot.jl | 11 ----------- 3 files changed, 11 insertions(+), 22 deletions(-) diff --git a/src/args.jl b/src/args.jl index bc9ce5af..0b5750ab 100644 --- a/src/args.jl +++ b/src/args.jl @@ -832,7 +832,7 @@ function preprocessArgs!(d::KW) d[:colorbar] = convertLegendValue(d[:colorbar]) end - + # framestyle if haskey(d, :framestyle) && haskey(_framestyleAliases, d[:framestyle]) d[:framestyle] = _framestyleAliases[d[:framestyle]] end diff --git a/src/axes.jl b/src/axes.jl index 6b3962a6..72745d86 100644 --- a/src/axes.jl +++ b/src/axes.jl @@ -499,14 +499,14 @@ function axis_drawing_info(sp::Subplot) if !(sp[:framestyle] == :none) # xaxis - f = scalefunc(yaxis[:scale]) - invf = invscalefunc(yaxis[:scale]) - t1 = invf(f(ymin) + 0.015*(f(ymax)-f(ymin))) - t2 = invf(f(ymax) - 0.015*(f(ymax)-f(ymin))) - sp[:framestyle] == :grid || push!(xaxis_segs, (xmin,ymin), (xmax,ymin)) # bottom spine / xaxis sp[:framestyle] in (:semi, :box) && push!(xborder_segs, (xmin,ymax), (xmax,ymax)) # top spine if !(xaxis[:ticks] in (nothing, false)) + f = scalefunc(yaxis[:scale]) + invf = invscalefunc(yaxis[:scale]) + t1 = invf(f(ymin) + 0.015*(f(ymax)-f(ymin))) + t2 = invf(f(ymax) - 0.015*(f(ymax)-f(ymin))) + for xtick in xticks[1] push!(xaxis_segs, (xtick, ymin), (xtick, t1)) # bottom tick # sp[:draw_axes_border] && push!(xaxis_segs, (xtick, ymax), (xtick, t2)) # top tick @@ -515,14 +515,14 @@ function axis_drawing_info(sp::Subplot) end # yaxis - f = scalefunc(xaxis[:scale]) - invf = invscalefunc(xaxis[:scale]) - t1 = invf(f(xmin) + 0.015*(f(xmax)-f(xmin))) - t2 = invf(f(xmax) - 0.015*(f(xmax)-f(xmin))) - sp[:framestyle] == :grid || push!(yaxis_segs, (xmin,ymin), (xmin,ymax)) # left spine / yaxis sp[:framestyle] in (:semi, :box) && push!(yborder_segs, (xmax,ymin), (xmax,ymax)) # right spine if !(yaxis[:ticks] in (nothing, false)) + f = scalefunc(xaxis[:scale]) + invf = invscalefunc(xaxis[:scale]) + t1 = invf(f(xmin) + 0.015*(f(xmax)-f(xmin))) + t2 = invf(f(xmax) - 0.015*(f(xmax)-f(xmin))) + for ytick in yticks[1] push!(yaxis_segs, (xmin, ytick), (t1, ytick)) # left tick # sp[:draw_axes_border] && push!(yaxis_segs, (xmax, ytick), (t2, ytick)) # right tick diff --git a/src/backends/pyplot.jl b/src/backends/pyplot.jl index 5db0ba6b..03c047bf 100644 --- a/src/backends/pyplot.jl +++ b/src/backends/pyplot.jl @@ -1108,17 +1108,6 @@ function _before_layout_calcs(plt::Plot{PyPlotBackend}) end end end - # if !sp[:draw_axes_border] - # if ispolar(sp) - # for (loc, spine) in ax[:spines] - # spine[:set_visible](false) - # end - # else - # # hide the right and top spines - # ax[:spines]["right"][:set_visible](false) - # ax[:spines]["top"][:set_visible](false) - # end - # end end py_drawfig(fig) end