Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0520035 commit 68f91d5Copy full SHA for 68f91d5
1 file changed
lib/matplotlib/sankey.py
@@ -739,7 +739,14 @@ def _get_angle(a, r):
739
if label is None or angle is None:
740
label = ''
741
elif self.unit is not None:
742
- quantity = self.format % abs(number) + self.unit
+ if self.format is None:
743
+ self.format = '%G'
744
+ if isinstance(self.format, str):
745
+ quantity = self.format % abs(number) + self.unit
746
+ elif callable(self.format):
747
+ quantity = self.format(100. * abs(number))
748
+ else:
749
+ raise TypeError('format must be callable or a format string')
750
if label != '':
751
label += "\n"
752
label += quantity
0 commit comments