-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Issue(?): head size of FancyArrowPatch changes between interactive figure and picture export #6035
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Thank you for your clear presentation of this problem. I think it is a combination of a confusing API plus one or more genuine bugs, and it is in parts of the codebase that most of us find difficult to work with. You are correct in thinking that changing the output dpi or the file format should not change the relative dimensions of plot elements, so we will need to track down whatever is violating this rule. |
After a quick scan of patches.py, I see a mysterious |
That seem relatively clean to me. Very nice analysis. Could you open a pull request with those changes to |
…it tests. Does break old unit tests of fancyarrow (test_arrow_patches.py)!
I have started to work on a branch that includes the proposed workaround in Besides I tried to write some |
It is not impossible that we have tests that are ensuring wrong behavior. |
On 2016/02/23 8:23 AM, afvincent wrote:
Quick thought, tentative, since I haven't had time to look into this (Longer term, I hope we can make the whole API much clearer and easier Eric |
Based on what you wrote Eric, I think I finally found a way to correct this bug without altering the attribute |
…it tests. Does break old unit tests of fancyarrow (test_arrow_patches.py)!
…it tests. Does break old unit tests of fancyarrow (test_arrow_patches.py)!
…it tests. Does break old unit tests of fancyarrow (test_arrow_patches.py)!
Fixed by #6504. |
Issue (?)
When plotting a arrow (with
FancyArrowPatch
frommatplotlib.patches
), and exporting it to a picture, the size of its head is not consistent with what is displayed in the interactive figure. (The linewidth seems to remain OK between interactive and exported file, whatever format is used.)As far as I understand, it seems to be DPI-related:
savefig
, then everything is fine.I don't know if it is a bug or the expected behavior, but I find it disturbing to have an export that is (that) different from the interactive display.
Environment infos
Example script
Here is a script that generates a figure with 2 arrows (FancyArrowPatch), and exports it to different formats:
And below is a picture that compares the 6 different output files (2 x 3 bottom panels) with a screenshot of the interactive figure (top center panel).

Observations about the example
One can see that with the raster formats (PNG and JPG):
Concerning the (at least partially) vector formats that I tested (PDF and EPS, with purple labels), one can observe that the arrow heads do not have exactly the same size as in the interactive display either (they are slightly bigger).
The text was updated successfully, but these errors were encountered: