Fix axis limits for ticks = :native

This commit is contained in:
Andrew Palugniok 2018-04-09 21:28:45 +01:00
parent b009da4b47
commit aeaa0c5f8d
2 changed files with 5 additions and 2 deletions

View File

@ -264,7 +264,10 @@ function plotly_axis(plt::Plot, axis::Axis, sp::Subplot)
ax[:tickangle] = -axis[:rotation] ax[:tickangle] = -axis[:rotation]
lims = axis_limits(axis) lims = axis_limits(axis)
axis[:ticks] != :native ? ax[:range] = map(scalefunc(axis[:scale]), lims) : nothing
if axis[:ticks] != :native || axis[:lims] != :auto
ax[:range] = map(scalefunc(axis[:scale]), lims)
end
if !(axis[:ticks] in (nothing, :none, false)) if !(axis[:ticks] in (nothing, :none, false))
ax[:titlefont] = plotly_font(guidefont(axis)) ax[:titlefont] = plotly_font(guidefont(axis))

View File

@ -1077,7 +1077,7 @@ function _before_layout_calcs(plt::Plot{PyPlotBackend})
pyaxis[Symbol(:tick_, pos)]() # the tick labels pyaxis[Symbol(:tick_, pos)]() # the tick labels
end end
py_set_scale(ax, axis) py_set_scale(ax, axis)
axis[:ticks] != :native ? py_set_lims(ax, axis) : nothing axis[:ticks] != :native || axis[:lims] != :auto ? py_set_lims(ax, axis) : nothing
if ispolar(sp) && letter == :y if ispolar(sp) && letter == :y
ax[:set_rlabel_position](90) ax[:set_rlabel_position](90)
end end