Closed
Description
This example showcases two instances where the view limits in 1.5.3 are not the same as when using 2.0.0rc1 with the classic style.
from distutils.version import LooseVersion
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
if LooseVersion(mpl.__version__) >= LooseVersion('2.0.0'):
plt.style.use('classic')
cc_t = np.arange(-100, 101, 5) / 1000
cc_concave = np.ones_like(cc_t)
fig, ax = plt.subplots()
ax.plot(cc_t, cc_concave, ls="", marker=".", color="0.7",
label="xcorr (concave)")
ax.set_title(mpl.__version__)
np.random.seed(0)
freq = np.arange(0.0, 100.0, 0.001)
resp = np.random.rand(*freq.shape) + 1j * np.random.rand(*freq.shape)
fig, (ax1, ax2) = plt.subplots(2, 1, sharex=True)
ax1.loglog(freq, abs(resp), lw=1.5)
ax1.set_title(mpl.__version__)
ax2.semilogx(freq, np.angle(resp), lw=1.5)
ax2.set_title(mpl.__version__)
plt.show()
For the first plot, with 1.5.3, the resulting image, with view limits (-0.1, 0.15), is:
but with 2.0.0rc1 in classic style, its view limits are (-0.1, 0.1):
For the second plot, with 1.5.3, the result image, with view limits (10^-3, 10^2), is:
but with 2.0.0rc1 in classic style, its view limits are (10^-7, 10^2):
The interesting thing is that this view limit is only triggered if something is plotted in both axes.