Skip to content

Commit 1a0ebbb

Browse files
authored
Merge pull request #21051 from anntzer/gdbdashes
set_dashes does not support offset=None anymore.
2 parents 592319e + f012a0d commit 1a0ebbb

File tree

2 files changed

+3
-25
lines changed

2 files changed

+3
-25
lines changed

lib/matplotlib/backend_bases.py

+2-4
Original file line numberDiff line numberDiff line change
@@ -914,15 +914,13 @@ def set_dashes(self, dash_offset, dash_list):
914914
915915
Parameters
916916
----------
917-
dash_offset : float or None
917+
dash_offset : float
918918
The offset (usually 0).
919919
dash_list : array-like or None
920-
The on-off sequence as points.
920+
The on-off sequence as points. None specifies a solid line.
921921
922922
Notes
923923
-----
924-
``(None, None)`` specifies a solid line.
925-
926924
See p. 107 of to PostScript `blue book`_ for more info.
927925
928926
.. _blue book: https://www-cdf.fnal.gov/offline/PostScript/BLUEBOOK.PDF

src/py_converters.cpp

+1-21
Original file line numberDiff line numberDiff line change
@@ -212,33 +212,13 @@ int convert_dashes(PyObject *dashobj, void *dashesp)
212212
{
213213
Dashes *dashes = (Dashes *)dashesp;
214214

215-
if (dashobj == NULL && dashobj == Py_None) {
216-
return 1;
217-
}
218-
219-
PyObject *dash_offset_obj = NULL;
220215
double dash_offset = 0.0;
221216
PyObject *dashes_seq = NULL;
222217

223-
if (!PyArg_ParseTuple(dashobj, "OO:dashes", &dash_offset_obj, &dashes_seq)) {
218+
if (!PyArg_ParseTuple(dashobj, "dO:dashes", &dash_offset, &dashes_seq)) {
224219
return 0;
225220
}
226221

227-
if (dash_offset_obj != Py_None) {
228-
dash_offset = PyFloat_AsDouble(dash_offset_obj);
229-
if (PyErr_Occurred()) {
230-
return 0;
231-
}
232-
} else {
233-
if (PyErr_WarnEx(PyExc_FutureWarning,
234-
"Passing the dash offset as None is deprecated since "
235-
"Matplotlib 3.3 and will be removed in Matplotlib 3.5; "
236-
"pass it as zero instead.",
237-
1)) {
238-
return 0;
239-
}
240-
}
241-
242222
if (dashes_seq == Py_None) {
243223
return 1;
244224
}

0 commit comments

Comments
 (0)