diff --git a/src/backends/gr.jl b/src/backends/gr.jl index 5e1c6785..9cf15144 100644 --- a/src/backends/gr.jl +++ b/src/backends/gr.jl @@ -1451,7 +1451,8 @@ function gr_label_axis_3d(sp, letter) x_offset = -gr_axis_width(sp, ax) y_offset = 0 end - gr_text(x + x_offset, y - y_offset, ax[:guide]) + letter === :z && GR.setcharup(-1, 0) + gr_text(x + x_offset, y + y_offset, ax[:guide]) GR.restorestate() end end diff --git a/src/examples.jl b/src/examples.jl index 1b44c11b..3273b93b 100644 --- a/src/examples.jl +++ b/src/examples.jl @@ -1048,6 +1048,25 @@ const _examples = PlotExample[ heatmap(z, projection = :polar) end] ), + PlotExample( # 50 + "3D surface with axis guides", + "", + [quote + f(x,a) = 1/x + a*x^2 + xs = collect(0.1:0.05:2.0); + as = collect(0.2:0.1:2.0); + + x_grid = [x for x in xs for y in as]; + a_grid = [y for x in xs for y in as]; + + plot(x_grid, a_grid, f.(x_grid,a_grid), + st = :surface, + xlabel = "longer xlabel", + ylabel = "longer ylabel", + zlabel = "longer zlabel", + ) + end] + ), ] # Some constants for PlotDocs and PlotReferenceImages