Fix outline linewidth mismatch between matplotlib and datashader#543
Merged
Fix outline linewidth mismatch between matplotlib and datashader#543
Conversation
Datashader's Canvas.line() interprets line_width in canvas pixels, while matplotlib uses points (1pt = 1/72 inch). Applying a dpi/72 scaling factor brings the datashader outline width in line with the matplotlib result. Fixes #493 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #543 +/- ##
=======================================
Coverage 84.00% 84.00%
=======================================
Files 9 9
Lines 2600 2601 +1
=======================================
+ Hits 2184 2185 +1
Misses 416 416
🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
outline_widthvalueCanvas.line()uses canvas pixelsdpi / 72scaling factor to convert points → pixels before passing to datashader, matching the existing DPI-scaling pattern used for point sizes (render.py:805)Test plan
test_datashader_outline_width_uses_points_unitscovering single and tuple outline widthsmain)🤖 Generated with Claude Code