When using plt.scatter with log-scaled axes, order of calls is important: if axes are set to log scale before plt.scatter is called, margins of the plot are huge:
import matplotlib.pyplot as plt
import numpy as np
f, ax = plt.subplots()
ax.set_xscale('log')
ax.set_yscale('log')
ax.scatter(2**np.arange(10), 2**np.arange(10))
Actual outcome

Expected outcome
When plt.scatter is called before axes are set to log scale, it looks normal:
import matplotlib.pyplot as plt
import numpy as np
f, ax = plt.subplots()
ax.scatter(2**np.arange(10), 2**np.arange(10))
ax.set_xscale('log')
ax.set_yscale('log')

- Operating system: Ubuntu 18.04
- Matplotlib version: 3.1.1
- Matplotlib backend (
print(matplotlib.get_backend())): module://ipykernel.pylab.backend_inline
- Python version: 3.8
- Jupyter version (if applicable): Jupyter Lab 1.1.4
In some earlier version of matplotlib (or something else) it worked as expected with any order of calls, but now I am getting this problem.
When using
plt.scatterwith log-scaled axes, order of calls is important: if axes are set to log scale beforeplt.scatteris called, margins of the plot are huge:Actual outcome

Expected outcome
When
plt.scatteris called before axes are set to log scale, it looks normal:print(matplotlib.get_backend())): module://ipykernel.pylab.backend_inlineIn some earlier version of matplotlib (or something else) it worked as expected with any order of calls, but now I am getting this problem.