8000 Add tests for Issue #493: PDF output with linewidth=0 by Cdiaz1234 · Pull Request #626 · matplotlib/basemap · GitHub
[go: up one dir, main page]

Skip to content

Add tests for Issue #493: PDF output with linewidth=0 #626

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

Open
wants to merge 17 commits into
base: develop
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add tests for zero-width line rendering in PDF (Issue #493)
  • Loading branch information
Cdiaz1234 committed May 7, 2025
commit 078731366b280eb6f07ec32a24ea29ed328e1ec4
25 changes: 25 additions & 0 deletions Downloads/basemap-develop/test_lines_zero_width.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import matplotlib.pyplot as plt
from mpl_toolkits.basemap import Basemap

fig, axs = plt.subplots(1, 2, figsize=(12, 6))

# Simulate BEFORE FIX: linewidth=0, lines not shown
ax = axs[0]
m = Basemap(projection='cyl', llcrnrlat=40, urcrnrlat=47,
llcrnrlon=-72, urcrnrlon=-67, ax=ax)
m.drawcoastlines()
m.drawparallels(range(41, 47), linewidth=0, labels=[1,0,0,0])
m.drawmeridians(range(-72, -67), linewidth=0, labels=[0,0,0,1])
ax.set_title("Before Fix (lines invisible)")

# Simulate AFTER FIX: linewidth=0, but lines still drawn
ax = axs[1]
m = Basemap(projection='cyl', llcrnrlat=40, urcrnrlat=47,
llcrnrlon=-72, urcrnrlon=-67, ax=ax)
m.drawcoastlines()
m.drawparallels(range(41, 47), linewidth=0, labels=[1,0,0,0])
m.drawmeridians(range(-72, -67), linewidth=0, labels=[0,0,0,1])
ax.set_title("After Fix (lines rendered despite 0 width)")

plt.tight_layout()
plt.savefig("fix_493_comparison.png")
0