Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions kippenhahn/kippenhahn.py
Original file line number Diff line number Diff line change
Expand Up @@ -968,7 +968,7 @@ def plot(self, ax=None):



if self._param['signed_log_cmap'] and (self._cmap_label is not None):
if self._param['signed_log_cmap'] and (self._param['cmap_label'] is not None):
cmap_label = "sign x log(max(1,abs(" + cmap_label[4:]+"))"


Expand All @@ -991,7 +991,7 @@ def plot(self, ax=None):
if self._param['signed_log_cmap']:
data_to_plot = np.sign(np.transpose(self._data)) * np.log10(np.maximum(1.,np.abs(np.transpose(self._data))))
else:
data_to_plot = np.log10(np.transpose(self._data))
data_to_plot = np.log10(np.maximum(1e-99,np.transpose(self._data)))

#Define the minimum and maximum of the color scale
# When using signed_log_cmap, ignore cmap_dynamic_range
Expand All @@ -1004,9 +1004,12 @@ def plot(self, ax=None):
self._param['cmap_dynamic_range'] = np.nanmax(data_to_plot) - np.nanmin(data_to_plot)
cmap_min = np.nanmax(data_to_plot)-self._param['cmap_dynamic_range']
cmap_max = np.nanmax(data_to_plot)
else:
elif self._param['cmap_dynamic_range']!=0:
cmap_min = np.nanmax(data_to_plot)-self._param['cmap_dynamic_range']
cmap_max = np.nanmax(data_to_plot)
else:
cmap_min = np.nanmin(data_to_plot)
cmap_max = np.nanmax(data_to_plot)


if ax is None:
Expand Down