-
-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Description
Problem
When using SymmetricalLogLocator (symlog scale), the linear region around zero often has very sparse tick density.
This is especially noticeable when linthresh is small compared to the data range. As a result, plots become harder to read near zero because there are not enough ticks to understand scale transitions.
Currently, the linear region typically contains only a minimal number of ticks, which can make the visualization uneven compared to logarithmic regions.
Proposed solution
Proposed approach
One possible approach is to add a small number of evenly spaced ticks within the linear region [-linthresh, linthresh] when both logarithmic and linear segments are present.
This could:
- Respect the existing
numticksbudget - Add only a limited number of linear ticks
- Preserve ordering and uniqueness
- Avoid affecting minor tick locators
The goal is to improve readability near zero while maintaining current logarithmic behavior elsewhere.
Example
import numpy as np
import matplotlib.pyplot as plt
x = np.linspace(-100, 100, 1000)
y = x
fig, ax = plt.subplots()
ax.plot(x, y)
ax.set_yscale("symlog")
plt.show()
