diff --git a/src/craterstats/Cratercount.py b/src/craterstats/Cratercount.py index d695b52..8941b52 100644 --- a/src/craterstats/Cratercount.py +++ b/src/craterstats/Cratercount.py @@ -155,7 +155,7 @@ def ReadSCCfile(self): if 'Perimeter' in s.keys(): self.perimeter = float(s['Perimeter']) if 'Total_perimeter' in s.keys(): #for Thomas Heyer's OpenCraterTool - self.perimeter = float(s['Total_perimeter']) + self.perimeter = float(re.findall('\s*[\d\.]*',s['Total_perimeter'])[0]) self.diam=[diam[e] for e in q] self.fraction=[frac[e] for e in q] self.prebinned=0 diff --git a/src/craterstats/Craterplot.py b/src/craterstats/Craterplot.py index 30b2826..9ea1b9d 100644 --- a/src/craterstats/Craterplot.py +++ b/src/craterstats/Craterplot.py @@ -147,7 +147,7 @@ def overplot(self,cps): ax = cps.fig.add_axes(pos3) self.pdf.plot(ax,pt_size=cps.scaled_pt_size,color=cps.palette[self.colour]) - if '#' in cps.legend: + if 'c' in cps.legend: if self.cratercount.buffered: legend_label += ['{:.1f}'.format(self.n_event)] else: diff --git a/src/craterstats/Craterplotset.py b/src/craterstats/Craterplotset.py index 572eece..779bf54 100644 --- a/src/craterstats/Craterplotset.py +++ b/src/craterstats/Craterplotset.py @@ -302,9 +302,10 @@ def draw(self): skip=False continue if e=='fit': - h1.append((h[i],h[i+1])) - b1.append(b[i+1]) - skip=True + skip = True + if set(self.legend) & set('crN') != set(): + h1.append((h[i],h[i+1])) + b1.append(b[i+1]) else: h1.append(h[i]) b1.append(e) diff --git a/src/craterstats/cli.py b/src/craterstats/cli.py index 98c135f..b72d839 100644 --- a/src/craterstats/cli.py +++ b/src/craterstats/cli.py @@ -59,7 +59,7 @@ def get_parser(): parser.add_argument("-yrange", help="y-axis range, log(min) log(max)", nargs=2) parser.add_argument("-isochrons", help="comma-separated isochron list in Ga, e.g. 1,3,3.7a,4a (optional combined suffix to modify label: n - suppress; a - above; s - small)") parser.add_argument("-show_isochrons", choices=['0', '1'], help="1 - show; 0 - suppress") - parser.add_argument("-legend", help="any combination of: n - name; a - area; # - number of craters; r - range; N - N(d_ref) value") + parser.add_argument("-legend", help="0 - suppress; or any combination of: n - name, a - area, c - number of craters, r - range, N - N(d_ref) value") parser.add_argument("-cite_functions", choices=['0','1'], help="1 - show; 0 - suppress") parser.add_argument("-mu", choices=['0','1'], help="1 - show; 0 - suppress") parser.add_argument("-style", choices=['natural', 'root-2'], help="diameter axis style") diff --git a/src/craterstats/config/default.plt b/src/craterstats/config/default.plt index a01dcf0..e20d125 100644 --- a/src/craterstats/config/default.plt +++ b/src/craterstats/config/default.plt @@ -7,7 +7,7 @@ set={ equilibrium='' invert=0 isochrons='' - legend='na#r' + legend='nacr' mu=1 presentation='differential' print_dimensions='7.5x7.5' diff --git a/src/craterstats/str_diameter_range.py b/src/craterstats/str_diameter_range.py index eed2d93..6aedfa1 100644 --- a/src/craterstats/str_diameter_range.py +++ b/src/craterstats/str_diameter_range.py @@ -14,6 +14,9 @@ def str_diameter_range(d,sf=2): """ # \u2013 en-dash \u2009 short space + if np.isinf(d[1]): + return 'unconstrained' + if d[1] >=1: s = gm.sigfigs(d, sf) return '{0[0]}\u2013{0[1]} km'.format(s)