Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit b8cb5d8

Browse filesBrowse files
committed
Add test for emtpy rasterised pdf figure
1 parent 2a01039 commit b8cb5d8
Copy full SHA for b8cb5d8

File tree

Expand file treeCollapse file tree

1 file changed

+8
-0
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+8
-0
lines changed

‎lib/matplotlib/tests/test_backend_pdf.py

Copy file name to clipboardExpand all lines: lib/matplotlib/tests/test_backend_pdf.py
+8Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,3 +232,11 @@ def test_failing_latex(tmpdir):
232232
plt.xlabel("$22_2_2$")
233233
with pytest.raises(RuntimeError):
234234
plt.savefig(path)
235+
236+
237+
def test_empty_rasterised():
238+
# Check that emtpy figures that are rasterised save to pdf files fine
239+
with PdfPages(io.BytesIO()) as pdf:
240+
fig, ax = plt.subplots()
241+
ax.plot([], [], rasterized=True)
242+
fig.savefig(pdf, format="pdf")

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.