You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The pgf backend's get_canvas_width_height returns the canvas size in
inches, but it should return it in display units ("pixels", or
inches*dpi) instead.
get_canvas_width_height is actually barely used (only in text.py for
some backends (not pgf), in collections.py as an optimization, and in
BboxImage -- the only really relevant case), so to show the failure,
apply
diff --git i/examples/text_labels_and_annotations/demo_text_path.py w/examples/text_labels_and_annotations/demo_text_path.py
index 47ed5dd..d45a922f4 100644
--- i/examples/text_labels_and_annotations/demo_text_path.py
+++ w/examples/text_labels_and_annotations/demo_text_path.py
@@ -61,6 +61,7 @@ class PathClippedImagePatch(mpatches.PathPatch):
if __name__ == "__main__":
+ import matplotlib; matplotlib.use("pgf")
usetex = plt.rcParams["text.usetex"]
fig = plt.figure()
@@ -156,4 +157,5 @@ if __name__ == "__main__":
ax.set_xlim(0, 1)
ax.set_ylim(0, 1)
+ plt.savefig("/tmp/test.pdf")
plt.show()
and observe that the image is incorrectly drawn before the patch, but
correctly after.
... 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.
0 commit comments