Skip to content

Commit 360b2f7

Browse files
committed
Merge remote-tracking branch 'matplotlib/v1.5.x' into v2.x
2 parents ad81e3f + 7cb9d1f commit 360b2f7

13 files changed

Lines changed: 53 additions & 29 deletions

‎lib/matplotlib/animation.py‎

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1114,8 +1114,8 @@ class FuncAnimation(TimedAnimation):
11141114
results of drawing from the first item in the frames sequence will be
11151115
used. This function will be called once before the first frame.
11161116
1117-
If blit=True, *func* and *init_func* should return an iterable of
1118-
drawables to clear.
1117+
If blit=True, *func* and *init_func* must return an iterable of
1118+
artists to be re-drawn.
11191119
11201120
*kwargs* include *repeat*, *repeat_delay*, and *interval*:
11211121
*interval* draws a new frame every *interval* milliseconds.
@@ -1196,6 +1196,9 @@ def _init_draw(self):
11961196
else:
11971197
self._drawn_artists = self._init_func()
11981198
if self._blit:
1199+
if self._drawn_artists is None:
1200+
raise RuntimeError('The init_func must return a '
1201+
'sequence of Artist objects.')
11991202
for a in self._drawn_artists:
12001203
a.set_animated(self._blit)
12011204
self._save_seq = []
@@ -1212,5 +1215,8 @@ def _draw_frame(self, framedata):
12121215
# func needs to return a sequence of any artists that were modified.
12131216
self._drawn_artists = self._func(framedata, *self._args)
12141217
if self._blit:
1218+
if self._drawn_artists is None:
1219+
raise RuntimeError('The animation function must return a '
1220+
'sequence of Artist objects.')
12151221
for a in self._drawn_artists:
12161222
a.set_animated(self._blit)

‎lib/matplotlib/axes/_axes.py‎

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3830,19 +3830,20 @@ def scatter(self, x, y, s=None, c=None, marker=None, cmap=None, norm=None,
38303830
# Process **kwargs to handle aliases, conflicts with explicit kwargs:
38313831

38323832
facecolors = None
3833-
ec = kwargs.pop('edgecolor', None)
3834-
if ec is not None:
3835-
edgecolors = ec
3836-
fc = kwargs.pop('facecolor', None)
3837-
if fc is not None:
3838-
facecolors = fc
3833+
edgecolors = kwargs.pop('edgecolor', edgecolors)
38393834
fc = kwargs.pop('facecolors', None)
3835+
fc = kwargs.pop('facecolor', fc)
38403836
if fc is not None:
38413837
facecolors = fc
3842-
# 'color' should be deprecated in scatter, or clearly defined;
3843-
# since it isn't, I am giving it low priority.
38443838
co = kwargs.pop('color', None)
38453839
if co is not None:
3840+
try:
3841+
mcolors.colorConverter.to_rgba_array(co)
3842+
except ValueError:
3843+
raise ValueError("'color' kwarg must be an mpl color"
3844+
" spec or sequence of color specs.\n"
3845+
"For a sequence of values to be"
3846+
" color-mapped, use the 'c' kwarg instead.")
38463847
if edgecolors is None:
38473848
edgecolors = co
38483849
if facecolors is None:

‎lib/matplotlib/backends/backend_ps.py‎

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -165,15 +165,16 @@ def _num_to_str(val):
165165
def _nums_to_str(*args):
166166
return ' '.join(map(_num_to_str,args))
167167

168+
168169
def quote_ps_string(s):
169170
"Quote dangerous characters of S for use in a PostScript string constant."
170-
s=s.replace("\\", "\\\\")
171-
s=s.replace("(", "\\(")
172-
s=s.replace(")", "\\)")
173-
s=s.replace("'", "\\251")
174-
s=s.replace("`", "\\301")
175-
s=re.sub(r"[^ -~\n]", lambda x: r"\%03o"%ord(x.group()), s)
176-
return s
171+
s = s.replace(b"\\", b"\\\\")
172+
s = s.replace(b"(", b"\\(")
173+
s = s.replace(b")", b"\\)")
174+
s = s.replace(b"'", b"\\251")
175+
s = s.replace(b"`", b"\\301")
176+
s = re.sub(br"[^ -~\n]", lambda x: br"\%03o" % ord(x.group()), s)
177+
return s.decode('ascii')
177178

178179

179180
def seq_allequal(seq1, seq2):

‎lib/matplotlib/backends/qt_editor/formlayout.py‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,7 @@ def setup(self):
298298
field = QtWidgets.QLineEdit(repr(value), self)
299299
field.setCursorPosition(0)
300300
field.setValidator(QtGui.QDoubleValidator(field))
301+
field.validator().setLocale(QtCore.QLocale("C"))
301302
dialog = self.get_dialog()
302303
dialog.register_float_field(field)
303304
field.textChanged.connect(lambda text: dialog.update_buttons())

‎lib/matplotlib/lines.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -781,7 +781,7 @@ def draw(self, renderer):
781781
drawFunc(renderer, gc, tpath, affine.frozen())
782782
gc.restore()
783783

784-
if self._marker:
784+
if self._marker and self._markersize > 0:
785785
gc = renderer.new_gc()
786786
self._set_gc_clip(gc)
787787
rgbaFace = self._get_rgba_face()
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
# Seaborn bright palette
22
axes.prop_cycle: cycler('color', ['003FFF', '03ED3A', 'E8000B', '8A2BE2', 'FFC400', '00D7FF'])
3+
patch.facecolor: 003FFF
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
# Seaborn colorblind palette
22
axes.prop_cycle: cycler('color', ['0072B2', '009E73', 'D55E00', 'CC79A7', 'F0E442', '56B4E9'])
3+
patch.facecolor: 0072B2
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
# Seaborn dark palette
22
axes.prop_cycle: cycler('color', ['001C7F', '017517', '8C0900', '7600A1', 'B8860B', '006374'])
3+
patch.facecolor: 001C7F
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
# Seaborn deep palette
22
axes.prop_cycle: cycler('color', ['4C72B0', '55A868', 'C44E52', '8172B2', 'CCB974', '64B5CD'])
3+
patch.facecolor: 4C72B0
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
# Seaborn muted palette
22
axes.prop_cycle: cycler('color', ['4878CF', '6ACC65', 'D65F5F', 'B47CC7', 'C4AD66', '77BEDB'])
3+
patch.facecolor: 4878CF

0 commit comments

Comments
 (0)