pyplot zlim fixes
This commit is contained in:
parent
cca730d927
commit
e8ed79a6bb
@ -550,7 +550,7 @@ function set_lims!(plt::Plot{PyPlotBackend}, axis::Symbol)
|
|||||||
if plt.plotargs[:ylims] == :auto
|
if plt.plotargs[:ylims] == :auto
|
||||||
ax[:set_ylim](minmaxseries(plt.seriesargs, :y, axis)...)
|
ax[:set_ylim](minmaxseries(plt.seriesargs, :y, axis)...)
|
||||||
end
|
end
|
||||||
if plt.plotargs[:zlims] == :auto
|
if plt.plotargs[:zlims] == :auto && haskey(ax, :set_zlim)
|
||||||
ax[:set_zlim](minmaxseries(plt.seriesargs, :z, axis)...)
|
ax[:set_zlim](minmaxseries(plt.seriesargs, :z, axis)...)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -577,24 +577,24 @@ end
|
|||||||
|
|
||||||
# -----------------------------------------------------------------
|
# -----------------------------------------------------------------
|
||||||
|
|
||||||
function addPyPlotLims(ax, lims, what)
|
function addPyPlotLims(ax, lims, dimension)
|
||||||
lims == :auto && return
|
lims == :auto && return
|
||||||
ltype = limsType(lims)
|
ltype = limsType(lims)
|
||||||
if ltype == :limits
|
if ltype == :limits
|
||||||
if what == :xlim
|
if dimension == :xlim
|
||||||
isfinite(lims[1]) && ax[:set_xlim](left = lims[1])
|
isfinite(lims[1]) && ax[:set_xlim](left = lims[1])
|
||||||
isfinite(lims[2]) && ax[:set_xlim](right = lims[2])
|
isfinite(lims[2]) && ax[:set_xlim](right = lims[2])
|
||||||
elseif what == :ylim
|
elseif dimension == :ylim
|
||||||
isfinite(lims[1]) && ax[:set_ylim](bottom = lims[1])
|
isfinite(lims[1]) && ax[:set_ylim](bottom = lims[1])
|
||||||
isfinite(lims[2]) && ax[:set_ylim](top = lims[2])
|
isfinite(lims[2]) && ax[:set_ylim](top = lims[2])
|
||||||
elseif what == :zlim
|
elseif dimension == :zlim && haskey(ax, :set_zlim)
|
||||||
isfinite(lims[1]) && ax[:set_zlim](bottom = lims[1])
|
isfinite(lims[1]) && ax[:set_zlim](bottom = lims[1])
|
||||||
isfinite(lims[2]) && ax[:set_zlim](top = lims[2])
|
isfinite(lims[2]) && ax[:set_zlim](top = lims[2])
|
||||||
else
|
else
|
||||||
error("Invalid argument at position 3: $what")
|
error("Invalid argument at position 3: $dimension")
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
error("Invalid input for $what: ", lims)
|
error("Invalid input for $dimension: ", lims)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -622,6 +622,7 @@ function _update_plot(plt::Plot{PyPlotBackend}, d::KW)
|
|||||||
ax = getLeftAxis(figorax)
|
ax = getLeftAxis(figorax)
|
||||||
# PyPlot.sca(ax)
|
# PyPlot.sca(ax)
|
||||||
|
|
||||||
|
|
||||||
# title and axis labels
|
# title and axis labels
|
||||||
# haskey(d, :title) && PyPlot.title(d[:title])
|
# haskey(d, :title) && PyPlot.title(d[:title])
|
||||||
haskey(d, :title) && ax[:set_title](d[:title])
|
haskey(d, :title) && ax[:set_title](d[:title])
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user