11API CHANGES in matplotlib-0.54
22
3- Autoscaling:
3+ matlab interface
4+ ================
5+
6+ pcolor and scatter
7+ ------------------
8+
9+ There are two changes to the matlab interface API, both involving the
10+ patch drawing commands. For efficiency, pcolor and scatter have been
11+ rewritten to use polygon collections, which are a new set of objects
12+ from matplotlib.collections designed to enable efficient handling of
13+ large collections of objects. These new collections make it possible
14+ to build large scatter plots or pcolor plots with no loops at the
15+ python level, and are significantly faster than their predecessors.
16+ The original pcolor and scatter functions are retained as
17+ pcolor_classic and scatter_classic.
18+
19+ The return value from pcolor is a PolyCollection. Most of the
20+ propertes that are available on rectangles or other patches are also
21+ available on PolyCollections, eg you can say
22+
23+ c = scatter(blah, blah)
24+ c.set_linewidth(1.0)
25+ c.set_facecolor('r')
26+ c.set_alpha(0.5)
27+
28+ or
29+
30+ c = scatter(blah, blah)
31+ set(c, 'linewidth', 1.0, 'facecolor', 'r', 'alpha', 0.5)
32+
33+
34+ Because the collection is a single object, you no longer need to loop
35+ over the return value of scatter or pcolor to set properties for the
36+ entire list.
37+
38+ If you want the different elements of a collection to vary on a
39+ property, eg to have different line widths, see matplotlib.collections
40+ for a discussion on how to set the properties as a sequence.
41+
42+ For scatter, the size argument is now in points^2 (the area of the
43+ symbol in points) as in matlab and is not in data coords as before.
44+ Using sizes in data coords caused several problems. So you will need
45+ to adjust your size arguments accordingly or use scatter_classic.
46+
47+
48+ Object interface - Application programmers
49+ ==========================================
50+
51+ Autoscaling
52+ ------------
453
554 The x and y axis instances no longer have autoscale view. These are
655 handled by axes.autoscale_view
756
8- Axes creation:
57+ Axes creation
58+ --------------
959
1060 You should not instantiate your own Axes any more using the OO API.
1161 Rather, create a Figure as before and in place of
@@ -24,12 +74,14 @@ Axes creation:
2474 add_axes(rect, axisbg=defaultcolor, frameon=True)
2575 add_subplot(num, axisbg=defaultcolor, frameon=True)
2676
27- Artist methods:
77+ Artist methods
78+ ---------------
2879
2980 If you define your own Artists, you need to rename the _draw method
3081 to draw
3182
32- Bounding boxes.
83+ Bounding boxes
84+ --------------
3385
3486 matplotlib.transforms.Bound2D is replaced by
3587 matplotlib.transforms.Bbox. If you want to construct a bbox from
@@ -52,7 +104,8 @@ Bounding boxes.
52104
53105
54106
55- Object constructors:
107+ Object constructors
108+ -------------------
56109
57110 You no longer pass the bbox, dpi, or transforms to the various
58111 Artist constructors. The old way or creating lines and rectangles
@@ -81,7 +134,8 @@ Object constructors:
81134 and the axes will set the transformation for you (unless you have
82135 set your own already, in which case it will eave it unchanged)
83136
84- Transformations:
137+ Transformations
138+ ---------------
85139
86140 The entire transformation architecture has been rewritten.
87141 Previously the x and y transformations where stored in the xaxis and
@@ -118,11 +172,6 @@ Transformations:
118172 See unit/transforms_unit.py for many examples using the new
119173 transformations.
120174
121-
122-
123-
124-
125-
126175API changes at 0.50
127176
128177 * refactored Figure class so it is no longer backend dependent.
0 commit comments