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

Skip to content

Commit cde9ac9

Browse files
committed
Fix errorbar extension arrows
1 parent f420992 commit cde9ac9

12 files changed

+3216
-3300
lines changed

lib/matplotlib/axes/_axes.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2917,9 +2917,9 @@ def xywhere(xs, ys, mask):
29172917
barcols.append(self.hlines(yo, lo, ro, **lines_kw))
29182918
rightup, yup = xywhere(right, y, xlolims & everymask)
29192919
if self.xaxis_inverted():
2920-
marker = mlines.CARETLEFT
2920+
marker = mlines.CARETLEFTBASE
29212921
else:
2922-
marker = mlines.CARETRIGHT
2922+
marker = mlines.CARETRIGHTBASE
29232923
caplines.extend(
29242924
self.plot(rightup, yup, ls='None', marker=marker,
29252925
**plot_kw))
@@ -2933,9 +2933,9 @@ def xywhere(xs, ys, mask):
29332933
barcols.append(self.hlines(yo, lo, ro, **lines_kw))
29342934
leftlo, ylo = xywhere(left, y, xuplims & everymask)
29352935
if self.xaxis_inverted():
2936-
marker = mlines.CARETRIGHT
2936+
marker = mlines.CARETRIGHTBASE
29372937
else:
2938-
marker = mlines.CARETLEFT
2938+
marker = mlines.CARETLEFTBASE
29392939
caplines.extend(
29402940
self.plot(leftlo, ylo, ls='None', marker=marker,
29412941
**plot_kw))
@@ -2981,9 +2981,9 @@ def xywhere(xs, ys, mask):
29812981
barcols.append(self.vlines(xo, lo, uo, **lines_kw))
29822982
xup, upperup = xywhere(x, upper, lolims & everymask)
29832983
if self.yaxis_inverted():
2984-
marker = mlines.CARETDOWN
2984+
marker = mlines.CARETDOWNBASE
29852985
else:
2986-
marker = mlines.CARETUP
2986+
marker = mlines.CARETUPBASE
29872987
caplines.extend(
29882988
self.plot(xup, upperup, ls='None', marker=marker,
29892989
**plot_kw))
@@ -2997,9 +2997,9 @@ def xywhere(xs, ys, mask):
29972997
barcols.append(self.vlines(xo, lo, uo, **lines_kw))
29982998
xlo, lowerlo = xywhere(x, lower, uplims & everymask)
29992999
if self.yaxis_inverted():
3000-
marker = mlines.CARETUP
3000+
marker = mlines.CARETUPBASE
30013001
else:
3002-
marker = mlines.CARETDOWN
3002+
marker = mlines.CARETDOWNBASE
30033003
caplines.extend(
30043004
self.plot(xlo, lowerlo, ls='None', marker=marker,
30053005
**plot_kw))

lib/matplotlib/lines.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,9 @@
3030
# Imported here for backward compatibility, even though they don't
3131
# really belong.
3232
from matplotlib.markers import TICKLEFT, TICKRIGHT, TICKUP, TICKDOWN
33-
from matplotlib.markers import CARETLEFT, CARETRIGHT, CARETUP, CARETDOWN
34-
33+
from matplotlib.markers import (
34+
CARETLEFT, CARETRIGHT, CARETUP, CARETDOWN,
35+
CARETLEFTBASE, CARETRIGHTBASE, CARETUPBASE, CARETDOWNBASE)
3536

3637
def segment_hits(cx, cy, x, y, radius):
3738
"""

lib/matplotlib/markers.py

Lines changed: 43 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,13 @@
3535
TICKRIGHT tickright
3636
TICKUP tickup
3737
TICKDOWN tickdown
38-
CARETLEFT caretleft
39-
CARETRIGHT caretright
40-
CARETUP caretup
41-
CARETDOWN caretdown
38+
CARETLEFT caretleft (centered at tip)
39+
CARETRIGHT caretright (centered at tip)
40+
CARETUP caretup (centered at tip)
41+
CARETDOWN caretdown (centered at tip)
42+
CARETLEFTBASE caretleft (centered at base)
43+
CARETRIGHTBASE caretright (centered at base)
44+
CARETUPBASE caretup (centered at base)
4245
"None" nothing
4346
None nothing
4447
" " nothing
@@ -91,7 +94,8 @@
9194

9295
# special-purpose marker identifiers:
9396
(TICKLEFT, TICKRIGHT, TICKUP, TICKDOWN,
94-
CARETLEFT, CARETRIGHT, CARETUP, CARETDOWN) = list(xrange(8))
97+
CARETLEFT, CARETRIGHT, CARETUP, CARETDOWN,
98+
CARETLEFTBASE, CARETRIGHTBASE, CARETUPBASE, CARETDOWNBASE) = list(xrange(12))
9599

96100

97101
class MarkerStyle(object):
@@ -128,6 +132,10 @@ class MarkerStyle(object):
128132
CARETRIGHT: 'caretright',
129133
CARETUP: 'caretup',
130134
CARETDOWN: 'caretdown',
135+
CARETLEFTBASE: 'caretleftbase',
136+
CARETRIGHTBASE: 'caretrightbase',
137+
CARETUPBASE: 'caretupbase',
138+
CARETDOWNBASE: 'caretdownbase',
131139
"None": 'nothing',
132140
None: 'nothing',
133141
' ': 'nothing',
@@ -779,6 +787,36 @@ def _set_caretright(self):
779787
self._path = self._caret_path
780788
self._joinstyle = 'miter'
781789

790+
_caret_path_base = Path([[-1.0, 0.0], [0.0, -1.5], [1.0, 0]])
791+
792+
def _set_caretdownbase(self):
793+
self._transform = Affine2D().scale(0.5)
794+
self._snap_threshold = 3.0
795+
self._filled = False
796+
self._path = self._caret_path_base
797+
self._joinstyle = 'miter'
798+
799+
def _set_caretupbase(self):
800+
self._transform = Affine2D().scale(0.5).rotate_deg(180)
801+
self._snap_threshold = 3.0
802+
self._filled = False
803+
self._path = self._caret_path_base
804+
self._joinstyle = 'miter'
805+
806+
def _set_caretleftbase(self):
807+
self._transform = Affine2D().scale(0.5).rotate_deg(270)
808+
self._snap_threshold = 3.0
809+
self._filled = False
810+
self._path = self._caret_path_base
811+
self._joinstyle = 'miter'
812+
813+
def _set_caretrightbase(self):
814+
self._transform = Affine2D().scale(0.5).rotate_deg(90)
815+
self._snap_threshold = 3.0
816+
self._filled = False
817+
self._path = self._caret_path_base
818+
self._joinstyle = 'miter'
819+
782820
_x_path = Path([[-1.0, -1.0], [1.0, 1.0],
783821
[-1.0, 1.0], [1.0, -1.0]],
784822
[Path.MOVETO, Path.LINETO,
Binary file not shown.

0 commit comments

Comments
 (0)