Skip to content

Commit

Permalink
fix: fix various deprecated matplotlib API usage
Browse files Browse the repository at this point in the history
  • Loading branch information
darvid committed Oct 11, 2023
1 parent 83787d1 commit 365dcdb
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion pyfair/report/distribution.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def generate_image(self):
ax.axes.xaxis.set_tick_params(rotation=-45)
ax.set_ylabel('Frequency Histogram')
for tick in ax.axes.xaxis.get_major_ticks():
tick.label.set_horizontalalignment('left')
tick.label1.set_horizontalalignment('left')
# Draw histrogram for each model
legend_labels = []
for name, model in self._input.items():
Expand Down
2 changes: 1 addition & 1 deletion pyfair/report/exceedence.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,5 +79,5 @@ def _generate_loss_curve(self, name, ax, space, loss_expectancy):
ax.axes.xaxis.set_major_formatter(StrMethodFormatter(self._currency_prefix + '{x:,.0f}'))
ax.axes.xaxis.set_tick_params(rotation=-45)
for tick in ax.axes.xaxis.get_major_ticks():
tick.label.set_horizontalalignment('left')
tick.label1.set_horizontalalignment('left')
ax.axes.set_title('Loss Exceedence Curve', fontsize=20)
7 changes: 4 additions & 3 deletions pyfair/report/tree_graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,8 @@ def _generate_text(self, row, ax):
output = '\n'.join([
key + ' ' + value.rjust(value_just)
for key, value
in data.iteritems()

in data.items()
])
elif supplied:
# Get rid of value less items and rename
Expand All @@ -158,15 +159,15 @@ def _generate_text(self, row, ax):
output = '\n'.join([
key + ' ' + value.rjust(value_just)
for key, value
in data.iteritems()
in data.items()
])
output = 'Raw input'
# And verything else ... so much nesting
else:
output = '\n'.join([
key + ' ' + value.rjust(value_just)
for key, value
in data.iteritems()
in data.items()
])
else:
output = ''
Expand Down

0 comments on commit 365dcdb

Please sign in to comment.