File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -409,14 +409,15 @@ def _adjust_fig_for_guide(self, guide):
409409 # Calculate and set the new width of the figure so the legend fits
410410 guide_width = guide .get_window_extent (renderer ).width / self .fig .dpi
411411 figure_width = self .fig .get_figwidth ()
412- self .fig .set_figwidth (figure_width + guide_width )
412+ total_width = figure_width + guide_width
413+ self .fig .set_figwidth (total_width )
413414
414415 # Draw the plot again to get the new transformations
415416 self .fig .draw (renderer )
416417
417418 # Now calculate how much space we need on the right side
418419 guide_width = guide .get_window_extent (renderer ).width / self .fig .dpi
419- space_needed = guide_width / ( figure_width + guide_width ) + 0.02
420+ space_needed = guide_width / total_width + 0.02
420421 # margin = .01
421422 # _space_needed = margin + space_needed
422423 right = 1 - space_needed
You can’t perform that action at this time.
0 commit comments