matplotlib.axes.Axes.add_collection#
- Axes.add_collection(collection, autolim=True)[source]#
Add a
Collectionto the Axes; return the collection.- Parameters:
- collection
Collection The collection to add.
- autolimbool
Whether to update data and view limits.
If False, the collection does not take part in any limit operations.
Changed in version 3.11: Since 3.11
autolim=Truematches the standard behavior of otheradd_[artist]methods: Axes data and view limits are both updated in the method, and the collection will be considered in future data limit updates throughrelim.Prior to matplotlib 3.11 this was only a one-time update of the data limits. Updating view limits required an explicit call to
autoscale_view, and collections did not take part inrelim.As an implementation detail, the value "_datalim_only" is supported to smooth the internal transition from pre-3.11 behavior. This is not a public interface and will be removed again in the future.
- collection
Examples using matplotlib.axes.Axes.add_collection#
Create boxes from error bars using PatchCollection