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
[Bug]: Log scaled barplots in PDF result in infinite rectangles #28175
Comments
Which tool are you using? I imported the plot in Inkscape and in neither of the import options (poppler/internal) it happens. Next step is to actually check the PDF content, but that will have to wait. (I also tried SVG to try to get some idea of where the problem happens, and the SVG also looked OK.) |
Sorry, I forgot to mention this: I am using Adobe Illustrator here. |
As far as I can tell, it isn't actually rendering incorrectly, correct? A bar plot on a log scale is an odd thing because there is an implied zero, and zero on log scale cannot exist. You CAN set a baseline e.g. I actually can see the path extending when I load the PDF into inkscape using the internal importer. The generated groups/top level thing that you click on is clipped, but if you go down to the thing labeled That said, it is correct as far as I'm concerned, and absent additional context as to why it is problematic (e.g. a common pdf program actually rendering it incorrectly or something that is explicitly out of PDF spec... here it seems to display fine, it is only in the editor that you see it is extended, which is the correct fundamental bar for what was plotted.), I'm inclined to say it is fine. A bar graph (by default) is from zero to a number, and zero on a log scale is at -inf... and it draws correctly. I do not see a particular reason we should be clipping paths when the vector formats we support already have clipping provided (and we use it, and it renders correctly). I believe we do something for lines where we remove some points, but that is about not bloating file size with points that are outside of the frame (IIRC, we clip to the Figure, not the axes to make sure we don't miss anything). There is no such file size concern for these paths, though. |
Bug summary
When saving log scaled barplots as PDFs, the bars get saved as rectangles with infinite size.
Code for reproduction
Actual outcome
Rectangles with infinite size
Expected outcome
Rectangles size capped at axis
Additional information
No response
Operating system
Linux, OS/X
Matplotlib Version
3.8.4
Matplotlib Backend
No response
Python version
No response
Jupyter version
No response
Installation
None
The text was updated successfully, but these errors were encountered: