Skip to content

Commit 6d0b5fe

Browse files
refactoring
1 parent 97f81f9 commit 6d0b5fe

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed

tikzplotlib/_cleanfigure.py

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -325,17 +325,17 @@ def _get_visual_limits(fighandle, axhandle):
325325
xLim = np.array(axhandle.get_xlim())
326326
yLim = np.array(axhandle.get_ylim())
327327
if is3D:
328-
zLim = np.array(axhandle.get_ylim())
328+
zLim = np.array(axhandle.get_zlim())
329329

330330
# Check for logarithmic scales
331-
isXlog = axhandle.get_xscale() == "log"
331+
isXlog = _axIsXLog(axhandle)
332332
if isXlog:
333333
xLim = np.log10(xLim)
334-
isYLog = axhandle.get_yscale() == "log"
334+
isYLog = _axIsYLog(axhandle)
335335
if isYLog:
336336
yLim = np.log10(yLim)
337337
if is3D:
338-
isZLog = axhandle.get_zscale() == "log"
338+
isZLog = _axIsZLog(axhandle)
339339
if isZLog:
340340
zLim = np.log10(zLim)
341341

@@ -542,6 +542,18 @@ def _axIs3D(axhandle):
542542
return hasattr(axhandle, "get_zlim")
543543

544544

545+
def _axIsXLog(axhandle):
546+
return axhandle.get_xscale() == "log"
547+
548+
549+
def _axIsYLog(axhandle):
550+
return axhandle.get_yscale() == "log"
551+
552+
553+
def _axIsZLog(axhandle3D):
554+
return axhandle3D.get_zscale() == "log"
555+
556+
545557
def _get_line_data(linehandle):
546558
"""Retrieve 2D or 3D data from line object.
547559

0 commit comments

Comments
 (0)