Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion lib/matplotlib/axes/_axes.py
Original file line number Diff line number Diff line change
Expand Up @@ -3657,7 +3657,8 @@ def scatter(self, x, y, s=20, c='b', marker='o', cmap=None, norm=None,
if self._ymargin < 0.05 and x.size > 0:
self.set_ymargin(0.05)

self.add_collection(collection)
self.add_collection(collection, autolim=False)
self.update_datalim(offsets)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't make sense to me. What if transOffset is not transData? It seems like add_collection should be handling all this correctly, and if it isn't then that is what needs to be fixed, not the code in scatter.
My impression is that the problem is coming from the basic design of mpl, in which some variables are set, calculations are done, and then later changes in those variables are not taken into account. The only way around it is a major redesign in which a full dependency relationship is established, and the evaluation occurs only at the last moment.

self.autoscale_view()

return collection
Expand Down