Closed
Description
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))
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.
Metadata
Metadata
Assignees
Labels
No labels