We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 85e3d4b commit cfc1d81Copy full SHA for cfc1d81
lib/matplotlib/backends/backend_pdf.py
@@ -139,7 +139,7 @@ def pdfRepr(obj):
139
# Floats. PDF does not have exponential notation (1.0e-10) so we
140
# need to use %f with some precision. Perhaps the precision
141
# should adapt to the magnitude of the number?
142
- elif isinstance(obj, float):
+ elif isinstance(obj, (float, np.floating)):
143
if not np.isfinite(obj):
144
raise ValueError("Can only output finite numbers in PDF")
145
r = ("%.10f" % obj).encode('ascii')
@@ -151,7 +151,7 @@ def pdfRepr(obj):
151
return [b'false', b'true'][obj]
152
153
# Integers are written as such.
154
- elif isinstance(obj, (int, long)):
+ elif isinstance(obj, (int, long, np.integer)):
155
return ("%d" % obj).encode('ascii')
156
157
# Unicode strings are encoded in UTF-16BE with byte-order mark.
0 commit comments