FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

ENH: pass dash_offset through to gc for Line2D by tacaswell · Pull Request #5433 · matplotlib/matplotlib · GitHub

Repository navigation

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .h  (1) .pdf  (1) .png  (1) .py  (3) .svg  (1) All 5 file types selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
6 changes: 4 additions & 2 deletions lib/matplotlib/backends/backend_ps.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -276,14 +276,16 @@ def set_linecap(self, linecap, store=1):
def set_linedash(self, offset, seq, store=1):
if self.linedash is not None:
oldo, oldseq = self.linedash
if seq_allequal(seq, oldseq): return
if seq_allequal(seq, oldseq) and oldo == offset:
return

if seq is not None and len(seq):
s="[%s] %d setdash\n"%(_nums_to_str(*seq), offset)
self._pswriter.write(s)
else:
self._pswriter.write("[] 0 setdash\n")
if store: self.linedash = (offset,seq)
if store:
self.linedash = (offset, seq)

def set_font(self, fontname, fontsize, store=1):
if rcParams['ps.useafm']: return
Expand Down
5 changes: 4 additions & 1 deletion lib/matplotlib/lines.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,7 @@ def __init__(self, xdata, ydata,
self.set_markersize(markersize)

self._dashSeq = None
self._dashOffset = 0

self._markeredgecolor = None
self._markeredgewidth = None
Expand Down Expand Up @@ -1028,6 +1029,7 @@ def set_linestyle(self, ls):
raise ValueError()

self.set_dashes(ls[1])
self._dashOffset = ls[0]
self._linestyle = "--"
return

Expand Down Expand Up @@ -1198,7 +1200,7 @@ def _draw_solid(self, renderer, gc, path, trans):
def _draw_dashed(self, renderer, gc, path, trans):
gc.set_linestyle('dashed')
if self._dashSeq is not None:
gc.set_dashes(0, self._dashSeq)
gc.set_dashes(self._dashOffset, self._dashSeq)

renderer.draw_path(gc, path, trans)

Expand All @@ -1222,6 +1224,7 @@ def update_from(self, other):
self._markeredgecolor = other._markeredgecolor
self._markeredgewidth = other._markeredgewidth
self._dashSeq = other._dashSeq
self._dashOffset = other._dashOffset
self._dashcapstyle = other._dashcapstyle
self._dashjoinstyle = other._dashjoinstyle
self._solidcapstyle = other._solidcapstyle
Expand Down
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Viewer requires iframe.
Loading

Back | FazBrowse Home | New Git URL