Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d5bddbc

Browse files
committed
Cleanup docs for GraphicsContextBase.{get,set}_dashes.
Note that the docs for get_dashes was wrong: the dash list is in points, not in pixels; this is documented e.g. in the line_demo_dash_control example; also the default dashstyle is (None, None).
1 parent 17d16f9 commit d5bddbc

File tree

1 file changed

+15
-12
lines changed

1 file changed

+15
-12
lines changed

lib/matplotlib/backend_bases.py

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -801,16 +801,14 @@ def get_clip_path(self):
801801

802802
def get_dashes(self):
803803
"""
804-
Return the dash information as an offset dashlist tuple.
804+
Return the dash style as an (offset, dash-list) pair.
805805
806-
The dash list is a even size list that gives the ink on, ink
807-
off in pixels.
806+
The dash list is a even-length list that gives the ink on, ink off in
807+
points. See p. 107 of to PostScript `blue book`_ for more info.
808808
809-
See p107 of to PostScript `BLUEBOOK
810-
<https://www-cdf.fnal.gov/offline/PostScript/BLUEBOOK.PDF>`_
811-
for more info.
809+
Default value is (None, None).
812810
813-
Default value is None
811+
.. _blue book: https://www-cdf.fnal.gov/offline/PostScript/BLUEBOOK.PDF
814812
"""
815813
return self._dashes
816814

@@ -904,13 +902,18 @@ def set_dashes(self, dash_offset, dash_list):
904902
905903
Parameters
906904
----------
907-
dash_offset : float
908-
is the offset (usually 0).
905+
dash_offset : float or None
906+
The offset (usually 0).
907+
dash_list : array_like or None
908+
The on-off sequence as points.
909909
910-
dash_list : array_like
911-
specifies the on-off sequence as points.
912-
``(None, None)`` specifies a solid line
910+
Notes
911+
-----
912+
``(None, None)`` specifies a solid line.
913+
914+
See p. 107 of to PostScript `blue book`_ for more info.
913915
916+
.. _blue book: https://www-cdf.fnal.gov/offline/PostScript/BLUEBOOK.PDF
914917
"""
915918
if dash_list is not None:
916919
dl = np.asarray(dash_list)

0 commit comments

Comments
 (0)