Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 4a5c939

Browse files
authored
Merge pull request #14749 from anntzer/pgfwh
Fix get_canvas_width_height() for pgf backend.
2 parents 64ba969 + 8713125 commit 4a5c939

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
The pgf backend's get_canvas_width_height now returns the canvas size in display units
2+
``````````````````````````````````````````````````````````````````````````````````````
3+
4+
... rather than in inches, which it previously did. The new behavior is the correct one given the uses of ``get_canvas_width_height`` in the rest of the codebase.

lib/matplotlib/backends/backend_pgf.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -736,7 +736,8 @@ def flipy(self):
736736

737737
def get_canvas_width_height(self):
738738
# docstring inherited
739-
return self.figure.get_figwidth(), self.figure.get_figheight()
739+
return (self.figure.get_figwidth() * self.dpi,
740+
self.figure.get_figheight() * self.dpi)
740741

741742
def points_to_pixels(self, points):
742743
# docstring inherited

0 commit comments

Comments
 (0)