Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 6d9e4de

Browse files
committed
updated docs
svn path=/trunk/matplotlib/; revision=302
1 parent ec0a6d2 commit 6d9e4de

2 files changed

Lines changed: 64 additions & 15 deletions

File tree

API_CHANGES

Lines changed: 60 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,61 @@
11
API 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-
126175
API changes at 0.50
127176

128177
* refactored Figure class so it is no longer backend dependent.

src/_transforms.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1135,11 +1135,11 @@ void Transformation::init_type()
11351135
add_varargs_method("freeze", &Transformation::freeze, "freeze(); eval and freeze the lazy objects\n");
11361136
add_varargs_method("thaw", &Transformation::thaw, "thaw(); release the laszy objects\n");
11371137

1138-
add_varargs_method("get_bbox1", &Transformation::get_bbox1, "get_bbox1(); return the Func instance on x\n");
1139-
add_varargs_method("get_bbox2", &Transformation::get_bbox2, "get_bbox2(); return the Func instance on y\n");
1138+
add_varargs_method("get_bbox1", &Transformation::get_bbox1, "get_bbox1(); return the input bbox\n");
1139+
add_varargs_method("get_bbox2", &Transformation::get_bbox2, "get_bbox2(); return the output bbox\n");
11401140

1141-
add_varargs_method("set_bbox1", &Transformation::set_bbox1, "set_bbox1(); set the Func instance on x\n");
1142-
add_varargs_method("set_bbox2", &Transformation::set_bbox2, "set_bbox2(); set the Func instance on y\n");
1141+
add_varargs_method("set_bbox1", &Transformation::set_bbox1, "set_bbox1(); set the input bbox\n");
1142+
add_varargs_method("set_bbox2", &Transformation::set_bbox2, "set_bbox2(); set the output bbox\n");
11431143

11441144
add_varargs_method("get_funcx", &Transformation::get_funcx, "get_funcx(); return the Func instance on x\n");
11451145
add_varargs_method("get_funcy", &Transformation::get_funcy, "get_funcy(); return the Func instance on y\n");

0 commit comments

Comments
 (0)