Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
Use autolim kwarg in add_collection to prevent duplication of effort.#3100
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Changes fromall commits
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -965,7 +965,7 @@ def hlines(self, y, xmin, xmax, colors='k', linestyles='solid', | ||
for thisxmin, thisxmax, thisy in zip(xmin, xmax, y)] | ||
coll = mcoll.LineCollection(verts, colors=colors, | ||
linestyles=linestyles, label=label) | ||
self.add_collection(coll, autolim=False) | ||
coll.update(kwargs) | ||
if len(y) > 0: | ||
@@ -1045,7 +1045,7 @@ def vlines(self, x, ymin, ymax, colors='k', linestyles='solid', | ||
#print 'creating line collection' | ||
coll = mcoll.LineCollection(verts, colors=colors, | ||
linestyles=linestyles, label=label) | ||
self.add_collection(coll, autolim=False) | ||
coll.update(kwargs) | ||
if len(x) > 0: | ||
@@ -1210,7 +1210,7 @@ def eventplot(self, positions, orientation='horizontal', lineoffsets=1, | ||
linewidth=linewidth, | ||
color=color, | ||
linestyle=linestyle) | ||
self.add_collection(coll, autolim=False) | ||
coll.update(kwargs) | ||
colls.append(coll) | ||
@@ -3937,7 +3937,7 @@ def hexbin(self, x, y, C=None, gridsize=100, bins=None, | ||
self.autoscale_view(tight=True) | ||
# add the collection last | ||
self.add_collection(collection, autolim=False) | ||
if not marginals: | ||
return collection | ||
@@ -3983,7 +3983,7 @@ def coarse_bin(x, y, coarse): | ||
hbar.set_norm(norm) | ||
hbar.set_alpha(alpha) | ||
hbar.update(kwargs) | ||
self.add_collection(hbar, autolim=False) | ||
coarse = np.linspace(ymin, ymax, gridsize) | ||
ycoarse = coarse_bin(yorig, C, coarse) | ||
@@ -4011,7 +4011,7 @@ def coarse_bin(x, y, coarse): | ||
vbar.set_norm(norm) | ||
vbar.set_alpha(alpha) | ||
vbar.update(kwargs) | ||
self.add_collection(vbar, autolim=False) | ||
collection.hbar = hbar | ||
collection.vbar = vbar | ||
@@ -4073,7 +4073,7 @@ def quiver(self, *args, **kw): | ||
self.cla() | ||
q = mquiver.Quiver(self, *args, **kw) | ||
self.add_collection(q,autolim=True) | ||
self.autoscale_view() | ||
return q | ||
quiver.__doc__ = mquiver.Quiver.quiver_doc | ||
@@ -4113,7 +4113,7 @@ def barbs(self, *args, **kw): | ||
if not self._hold: | ||
self.cla() | ||
b = mquiver.Barbs(self, *args, **kw) | ||
self.add_collection(b, autolim=True) | ||
self.autoscale_view() | ||
return b | ||
@@ -4301,9 +4301,10 @@ def get_interp_point(ind): | ||
XY2 = np.array([x[where], y2[where]]).T | ||
self.dataLim.update_from_data_xy(XY1, self.ignore_existing_data_limits, | ||
updatex=True, updatey=True) | ||
self.ignore_existing_data_limits = False | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. Why did this get added? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. This flag is initialized to True by | ||
self.dataLim.update_from_data_xy(XY2, self.ignore_existing_data_limits, | ||
updatex=False, updatey=True) | ||
self.add_collection(collection, autolim=False) | ||
self.autoscale_view() | ||
return collection | ||
@@ -4408,10 +4409,10 @@ def fill_betweenx(self, y, x1, x2=0, where=None, **kwargs): | ||
X2Y = np.array([x2[where], y[where]]).T | ||
self.dataLim.update_from_data_xy(X1Y, self.ignore_existing_data_limits, | ||
updatex=True, updatey=True) | ||
self.ignore_existing_data_limits = False | ||
self.dataLim.update_from_data_xy(X2Y, self.ignore_existing_data_limits, | ||
updatex=True, updatey=False) | ||
self.add_collection(collection, autolim=False) | ||
self.autoscale_view() | ||
return collection | ||
@@ -4886,7 +4887,7 @@ def pcolor(self, *args, **kwargs): | ||
corners = (minx, miny), (maxx, maxy) | ||
self.update_datalim(corners) | ||
self.autoscale_view() | ||
self.add_collection(collection, autolim=False) | ||
return collection | ||
@docstring.dedent_interpd | ||
@@ -5032,7 +5033,7 @@ def pcolormesh(self, *args, **kwargs): | ||
corners = (minx, miny), (maxx, maxy) | ||
self.update_datalim(corners) | ||
self.autoscale_view() | ||
self.add_collection(collection, autolim=False) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. I think the better solution (but not the quicker solution, so I'm happy this PR was merged) would be to implement an appropriate data limit updater on the QuadMeshCollection - I'm not sure I'll get around to doing this anytime soon, so just wanted to post it here as a reminder. | ||
return collection | ||
@docstring.dedent_interpd | ||
@@ -5184,7 +5185,7 @@ def pcolorfast(self, *args, **kwargs): | ||
collection.set_array(C) | ||
collection.set_cmap(cmap) | ||
collection.set_norm(norm) | ||
self.add_collection(collection, autolim=False) | ||
xl, xr, yb, yt = X.min(), X.max(), Y.min(), Y.max() | ||
ret = collection | ||