Skip to content

Commit 34b20af

Browse files
committed
Merge remote-tracking branch 'upstream/v1.2.x'
2 parents 3bee65c + 0f8bfe1 commit 34b20af

File tree

5 files changed

+54
-7
lines changed

5 files changed

+54
-7
lines changed

lib/matplotlib/colorbar.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,19 @@
174174
the axes objects in which the mappable and the colorbar are drawn. In
175175
this case, do not use any of the axes properties kwargs.
176176
177+
It is known that some vector graphics viewer (svg and pdf) renders white gaps
178+
between segments of the colorbar. This is due to bugs in the viewers not
179+
matplotlib. As a workaround the colorbar can be rendered with overlapping
180+
segments::
181+
182+
cbar = colorbar()
183+
cbar.solids.set_edgecolor("face")
184+
draw()
185+
186+
However this has negative consequences in other circumstances. Particularly with
187+
semi transparent images (alpha < 1) and colorbar extensions and is not enabled
188+
by default see (issue #1188).
189+
177190
returns:
178191
:class:`~matplotlib.colorbar.Colorbar` instance; see also its base class,
179192
:class:`~matplotlib.colorbar.ColorbarBase`. Call the

lib/matplotlib/markers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ def _half_fill(self):
276276

277277
def _set_circle(self, reduction = 1.0):
278278
self._transform = Affine2D().scale(0.5 * reduction)
279-
self._snap_threshold = 3.0
279+
self._snap_threshold = 6.0
280280
fs = self.get_fillstyle()
281281
if not self._half_fill():
282282
self._path = Path.unit_circle()

lib/matplotlib/widgets.py

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -841,6 +841,8 @@ def onmove(self, event):
841841
'on mouse motion draw the cursor if visible'
842842
if self.ignore(event):
843843
return
844+
if not self.canvas.widgetlock.available(self):
845+
return
844846
if event.inaxes != self.ax:
845847
self.linev.set_visible(False)
846848
self.lineh.set_visible(False)
@@ -907,7 +909,8 @@ def __init__(self, canvas, axes, useblit=True, **lineprops):
907909
if useblit:
908910
lineprops['animated'] = True
909911

910-
self.lines = [ax.axvline(xmid, visible=False, **lineprops) for ax in axes]
912+
self.lines = [ax.axvline(xmid, visible=False, **lineprops)
913+
for ax in axes]
911914

912915
self.visible = True
913916
self.useblit = useblit
@@ -921,15 +924,20 @@ def __init__(self, canvas, axes, useblit=True, **lineprops):
921924
def clear(self, event):
922925
'clear the cursor'
923926
if self.useblit:
924-
self.background = self.canvas.copy_from_bbox(self.canvas.figure.bbox)
925-
for line in self.lines: line.set_visible(False)
927+
self.background = self.canvas.copy_from_bbox(
928+
self.canvas.figure.bbox)
929+
for line in self.lines:
930+
line.set_visible(False)
926931

927932

928933
def onmove(self, event):
929-
if event.inaxes is None: return
930-
if not self.canvas.widgetlock.available(self): return
934+
if event.inaxes is None:
935+
return
936+
if not self.canvas.widgetlock.available(self):
937+
return
931938
self.needclear = True
932-
if not self.visible: return
939+
if not self.visible:
940+
return
933941

934942
for line in self.lines:
935943
line.set_xdata((event.xdata, event.xdata))

lib/mpl_toolkits/axes_grid/colorbar.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,19 @@
144144
the axes objects in which the mappable and the colorbar are drawn. In
145145
this case, do not use any of the axes properties kwargs.
146146
147+
It is known that some vector graphics viewer (svg and pdf) renders white gaps
148+
between segments of the colorbar. This is due to bugs in the viewers not
149+
matplotlib. As a workaround the colorbar can be rendered with overlapping
150+
segments::
151+
152+
cbar = colorbar()
153+
cbar.solids.set_edgecolor("face")
154+
draw()
155+
156+
However this has negative consequences in other circumstances. Particularly with
157+
semi transparent images (alpha < 1) and colorbar extensions and is not enabled
158+
by default see (issue #1188).
159+
147160
returns:
148161
:class:`~matplotlib.colorbar.Colorbar` instance; see also its base class,
149162
:class:`~matplotlib.colorbar.ColorbarBase`. Call the

lib/mpl_toolkits/axes_grid1/colorbar.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,19 @@
144144
the axes objects in which the mappable and the colorbar are drawn. In
145145
this case, do not use any of the axes properties kwargs.
146146
147+
It is known that some vector graphics viewer (svg and pdf) renders white gaps
148+
between segments of the colorbar. This is due to bugs in the viewers not
149+
matplotlib. As a workaround the colorbar can be rendered with overlapping
150+
segments::
151+
152+
cbar = colorbar()
153+
cbar.solids.set_edgecolor("face")
154+
draw()
155+
156+
However this has negative consequences in other circumstances. Particularly with
157+
semi transparent images (alpha < 1) and colorbar extensions and is not enabled
158+
by default see (issue #1188).
159+
147160
returns:
148161
:class:`~matplotlib.colorbar.Colorbar` instance; see also its base class,
149162
:class:`~matplotlib.colorbar.ColorbarBase`. Call the

0 commit comments

Comments
 (0)