Skip to content

Commit

Permalink
Also fix set_limits_percent for negative vmin and logscale
Browse files Browse the repository at this point in the history
  • Loading branch information
maxnoe committed Nov 16, 2021
1 parent b0a1bc6 commit adb69df
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions ctapipe/visualization/mpl_camera.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,9 @@ def set_limits_percent(self, percent=95):
""" auto-scale the color range to percent of maximum """
zmin = np.nanmin(self.pixels.get_array())
zmax = np.nanmax(self.pixels.get_array())
if isinstance(self.pixels.norm, LogNorm):
zmin = zmin if zmin > 0 else 0.1

dz = zmax - zmin
frac = percent / 100.0
self.autoscale = False
Expand Down

0 comments on commit adb69df

Please sign in to comment.