Skip to content

Commit

Permalink
Fix kippenhan colormaps when all data is positive
Browse files Browse the repository at this point in the history
  • Loading branch information
rjfarmer committed May 25, 2023
1 parent 89e3d79 commit 66640a3
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions mesaPlot/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -5549,14 +5549,6 @@ def plotKip3(
extent = (xmin, xmax, ymin, ymax)
extent = np.double(np.array(extent))

if cmap_merge:
newCm = self.mergeCmaps(cmap, [[0.0, 0.5], [0.5, 1.0]])
else:
if not isinstance(cmap, str):
newCm = cmap[-1]
else:
newCm = cmap

if hasdataz:
if zlog:
# Get rid of warnigns about > nan's
Expand All @@ -5572,6 +5564,19 @@ def plotKip3(
vmax = np.maximum(np.abs(vmax), np.abs(vmin))
vmin = -vmax

if cmap_merge:
newCm = self.mergeCmaps(cmap, [[0.0, 0.5], [0.5, 1.0]])
else:
if not isinstance(cmap, str):
newCm = cmap[-1]
else:
newCm = cmap
else:
if not isinstance(cmap, str):
newCm = cmap[-1]
else:
newCm = cmap

if cmin is not None:
vmin = cmin

Expand Down

0 comments on commit 66640a3

Please sign in to comment.