Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
6 changes: 2 additions & 4 deletions lib/matplotlib/backend_bases.py
Original file line number Diff line number Diff line change
Expand Up @@ -914,15 +914,13 @@ def set_dashes(self, dash_offset, dash_list):

Parameters
----------
dash_offset : float or None
dash_offset : float
The offset (usually 0).
dash_list : array-like or None
The on-off sequence as points.
The on-off sequence as points. None specifies a solid line.

Notes
-----
``(None, None)`` specifies a solid line.

See p. 107 of to PostScript `blue book`_ for more info.

.. _blue book: https://www-cdf.fnal.gov/offline/PostScript/BLUEBOOK.PDF
Expand Down
22 changes: 1 addition & 21 deletions src/py_converters.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -212,33 +212,13 @@ int convert_dashes(PyObject *dashobj, void *dashesp)
{
Dashes *dashes = (Dashes *)dashesp;

if (dashobj == NULL && dashobj == Py_None) {
return 1;
}

PyObject *dash_offset_obj = NULL;
double dash_offset = 0.0;
PyObject *dashes_seq = NULL;

if (!PyArg_ParseTuple(dashobj, "OO:dashes", &dash_offset_obj, &dashes_seq)) {
if (!PyArg_ParseTuple(dashobj, "dO:dashes", &dash_offset, &dashes_seq)) {
return 0;
}

if (dash_offset_obj != Py_None) {
dash_offset = PyFloat_AsDouble(dash_offset_obj);
if (PyErr_Occurred()) {
return 0;
}
} else {
if (PyErr_WarnEx(PyExc_FutureWarning,
"Passing the dash offset as None is deprecated since "
"Matplotlib 3.3 and will be removed in Matplotlib 3.5; "
"pass it as zero instead.",
1)) {
return 0;
}
}

if (dashes_seq == Py_None) {
return 1;
}
Expand Down