Silent matplotlib Default Caused Map Frames to Render at Wrong Aspect Ratio
A developer building portrait-format map explainer videos discovered that rendered frames had far less map coverage than expected after a layout update across 15 episodes. Investigating the frame-by-frame pixel occupancy, they found one episode showed only 11% map-band coverage compared to 42% for another using identical settings. The culprit was a missing aspect='auto' argument in a matplotlib imshow() call used to draw country highlight glows, causing the axes to silently adopt an equal aspect ratio. This default behavior, inherited from the image.aspect rcParam, reshaped the axes geometry for nearly every scene in the pipeline without raising any error or warning. A separate imshow call in the same file for the progress bar correctly passed aspect='auto', meaning one call site had the fix while the other quietly distorted output for weeks.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in