From f84f0eb1cbdc7a82c073197e0fbe4533b889a3d1 Mon Sep 17 00:00:00 2001 From: Robert Farmer Date: Tue, 12 Jan 2021 14:58:43 +0100 Subject: [PATCH] Fix matplotlib depreciation warning --- mesaPlot/plot.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/mesaPlot/plot.py b/mesaPlot/plot.py index c2d434a..2316883 100644 --- a/mesaPlot/plot.py +++ b/mesaPlot/plot.py @@ -479,12 +479,14 @@ def _listAbun(self,data,prefix=''): def _splitIso(self,iso,prefix=''): name='' mass='' - iso=iso[len(prefix):] + if prefix in iso: + iso=iso[len(prefix):] for i in iso: if i.isdigit(): mass+=i else: name+=i + if 'neut' in name or 'prot' in name: mass=1 return name,int(mass) @@ -1061,9 +1063,9 @@ def _plotAnnotatedLine(self,ax,x,y,xmin,xmax,fy=None,ymin=None,ymax=None,annotat y=y[ind] if xlog: - ax.set_xscale("log", nonposx='clip') + ax.set_xscale("log", nonpositive='clip') if ylog: - ax.set_yscale("log", nonposy='clip') + ax.set_yscale("log", nonpositive='clip') if np.all(y<=0): return @@ -2034,10 +2036,10 @@ def plotKip3(self,m,plot_type='history',xaxis='model_number',yaxis='mass',zaxis= if y2 is not None: ax2=ax.twinx() if y2log: - ax2.set_yscale("log",nonposy='clip') + ax2.set_yscale("log",nonpositive='clip') if y1log: - ax.set_yscale("log", nonposy='clip') + ax.set_yscale("log", nonpositive='clip') if plot_type=='history':