trouble with log scales and clean_figure
bjuergens opened this issue · comments
clean_figure()
seems to break when using log-scales.
import matplotlib.pyplot as plt
import tikzplotlib
fig, axes = plt.subplots(1)
ax = axes
ax.plot(range(1,100), range(1,100))
ax.set_yscale('log')
tikzplotlib.clean_figure()
fig.show()
output (console):
/home/name/.venv/neuro/lib/python3.8/site-packages/tikzplotlib/_cleanfigure.py:613: RuntimeWarning: divide by zero encountered in log10
yData = np.log10(yData)
/home/name/.venv/neuro/lib/python3.8/site-packages/tikzplotlib/_cleanfigure.py:1001: RuntimeWarning: invalid value encountered in true_divide
v = v / np.linalg.norm(v)
output (image): https://i.imgur.com/n6S42ly.png
when I comment out the line tikzplotlib.clean_figure()
, don't get any console output (as expected) and the axes are scaled correctly: https://i.imgur.com/EAsrGqM.png
Perhaps @theRealSuperMario has an idea what may be causing this.
Sorry for the huge delay - gonna fix it today.