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):
409
409
# Calculate and set the new width of the figure so the legend fits
410
410
guide_width = guide .get_window_extent (renderer ).width / self .fig .dpi
411
411
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 )
413
414
414
415
# Draw the plot again to get the new transformations
415
416
self .fig .draw (renderer )
416
417
417
418
# Now calculate how much space we need on the right side
418
419
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
420
421
# margin = .01
421
422
# _space_needed = margin + space_needed
422
423
right = 1 - space_needed
You can’t perform that action at this time.
0 commit comments