matplotlib.axes.Axes.add_collection#

Axes.add_collection(collection,autolim=True)[source]#

Add aCollection to the Axes; return the collection.

Parameters:
collectionCollection

The collection to add.

autolimbool

Whether to update data and view limits.

Changed in version 3.11:This now also updates the view limits, making explicitcalls toautoscale_view unnecessary.

As an implementation detail, the value "_datalim_only" issupported to smooth the internal transition from pre-3.11behavior. This is not a public interface and will be removedagain in the future.

Examples usingmatplotlib.axes.Axes.add_collection#

Lasso Demo

Lasso Demo

EventCollection Demo

EventCollection Demo

Multicolored lines

Multicolored lines

Line, Poly and RegularPoly Collection

Line, Poly and RegularPoly Collection

Ellipse Collection

Ellipse Collection

Plot multiple lines using a LineCollection

Plot multiple lines using a LineCollection

Circles, Wedges and Polygons

Circles, Wedges and Polygons

Create boxes from error bars using PatchCollection

Create boxes from error bars using PatchCollection

Artist tests

Artist tests