Adding rounding parameter at partitioner.plot

This commit is contained in:
Petrônio Cândido de Lima e Silva 2018-11-27 12:52:52 -02:00 committed by GitHub
parent 32d15cd25c
commit 4029b4223d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -104,7 +104,7 @@ class Partitioner(object):
""" """
return self.sets[self.ordered_sets[-1]] return self.sets[self.ordered_sets[-1]]
def plot(self, ax): def plot(self, ax, rounding=0):
""" """
Plot the partitioning using the Matplotlib axis ax Plot the partitioning using the Matplotlib axis ax
@ -122,7 +122,7 @@ class Partitioner(object):
elif s.type == 'composite': elif s.type == 'composite':
for ss in s.sets: for ss in s.sets:
self.plot_set(ax, ss) self.plot_set(ax, ss)
ticks.append(str(round(s.centroid,0))+'\n'+s.name) ticks.append(str(round(s.centroid,rounding))+'\n'+s.name)
x.append(s.centroid) x.append(s.centroid)
ax.xaxis.set_ticklabels(ticks) ax.xaxis.set_ticklabels(ticks)
ax.xaxis.set_ticks(x) ax.xaxis.set_ticks(x)