-
Notifications
You must be signed in to change notification settings - Fork 293
Closed
Description
Bug report
Bug summary
Since yt 4.1.0, setting arbitrary colorbar norms is supported, however internally, isinstance(norm, SymLogNorm)
is used with no regards to the actual base (base 10 is implicitly assumed) to trigger some hard coded special behaviours (most importantly setting minor ticks, which isn't handled well by matplotlib for this norm type).
Code for reproduction
import yt
from matplotlib.colors import SymLogNorm
yt.set_log_level("warning")
ds = yt.load_sample("IsolatedGalaxy")
p = yt.SlicePlot(ds, "z", ("gas", "velocity_x"))
p.set_norm(("gas", "velocity_x"), SymLogNorm(linthresh=1, base=2))
p.save("/tmp/test_sym.png")
Actual outcome
yt : [WARNING ] 2023-05-21 14:59:45,100 Dropping norm constraints (norm_type=<class 'matplotlib.colors.Normalize'>)
Expected outcome
Ticks should be powers of 2 instead of powers of 10.
Version Information
- Operating System: MacOS
- Python Version: 3.11.1
- yt version: 4.1.x
- Other Libraries (if applicable): matplotlib 3.7.1