From 93df7f43679be2ce131129846ceec4f5461e9c46 Mon Sep 17 00:00:00 2001 From: Daniel Schwabeneder Date: Sun, 1 Oct 2017 19:09:24 +0200 Subject: [PATCH] implement showaxis for glvisualize --- src/backends/glvisualize.jl | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/src/backends/glvisualize.jl b/src/backends/glvisualize.jl index 1bdb79df..bbd5605a 100644 --- a/src/backends/glvisualize.jl +++ b/src/backends/glvisualize.jl @@ -732,15 +732,25 @@ function gl_draw_axes_2d(sp::Plots.Subplot{Plots.GLVisualizeBackend}, model, are xlim = Plots.axis_limits(xaxis) ylim = Plots.axis_limits(yaxis) - if !(xaxis[:ticks] in (nothing, false, :none)) && !(sp[:framestyle] == :none) + if !(xaxis[:ticks] in (nothing, false, :none)) && !(sp[:framestyle] == :none) && xaxis[:showaxis] ticklabels = map(model) do m mirror = xaxis[:mirror] t, positions, offsets = draw_ticks(xaxis, xticks, true, sp[:framestyle] == :origin, ylim, m) - mirror = xaxis[:mirror] - t, positions, offsets = draw_ticks( - yaxis, yticks, false, sp[:framestyle] == :origin, xlim, m, - t, positions, offsets - ) + end + kw_args = Dict{Symbol, Any}( + :position => map(x-> x[2], ticklabels), + :offset => map(last, ticklabels), + :color => fcolor, + :relative_scale => pointsize(xaxis[:tickfont]), + :scale_primitive => false + ) + push!(axis_vis, visualize(map(first, ticklabels), Style(:default), kw_args)) + end + + if !(yaxis[:ticks] in (nothing, false, :none)) && !(sp[:framestyle] == :none) && yaxis[:showaxis] + ticklabels = map(model) do m + mirror = yaxis[:mirror] + t, positions, offsets = draw_ticks(yaxis, yticks, false, sp[:framestyle] == :origin, xlim, m) end kw_args = Dict{Symbol, Any}( :position => map(x-> x[2], ticklabels),