|
1 | 1 |
|
2 | 2 | API Changes in matplotlib-0.83 |
3 | 3 |
|
4 | | - Made HOME/.matplotlib the new config dir where the matplotlibrc |
5 | | - file, the ttf.cache, and the tex.cache live. The new default |
6 | | - filenames in .matplotlib have no leading dot and are not hidden. |
7 | | - Eg, the new names are matplotlibrc tex.cache ttffont.cache. This is |
8 | | - how ipython does it so it must be right. |
9 | | - |
10 | | - If old files are found, a warning is issued and they are |
11 | | - moved to the new location. |
12 | | - |
13 | | - backends/__init__.py no longer imports new_figure_manager, |
14 | | - draw_if_interactive and show from the default backend, but puts |
15 | | - these imports into a call to pylab_setup. Also, the Toolbar is no |
16 | | - longer imported from WX/WXAgg. New usage |
17 | | - |
18 | | - from backends import pylab_setup |
19 | | - new_figure_manager, draw_if_interactive, show = pylab_setup() |
20 | | - |
| 4 | + - Made HOME/.matplotlib the new config dir where the matplotlibrc |
| 5 | + file, the ttf.cache, and the tex.cache live. The new default |
| 6 | + filenames in .matplotlib have no leading dot and are not hidden. |
| 7 | + Eg, the new names are matplotlibrc, tex.cache, and ttffont.cache. |
| 8 | + This is how ipython does it so it must be right. |
| 9 | + |
| 10 | + If old files are found, a warning is issued and they are moved to |
| 11 | + the new location. |
| 12 | + |
| 13 | + - backends/__init__.py no longer imports new_figure_manager, |
| 14 | + draw_if_interactive and show from the default backend, but puts |
| 15 | + these imports into a call to pylab_setup. Also, the Toolbar is no |
| 16 | + longer imported from WX/WXAgg. New usage: |
| 17 | + |
| 18 | + from backends import pylab_setup |
| 19 | + new_figure_manager, draw_if_interactive, show = pylab_setup() |
21 | 20 |
|
22 | | - Moved Figure.get_width_height() to FigureCanvasBase. It now returns |
23 | | - int instead of float. |
| 21 | + - Moved Figure.get_width_height() to FigureCanvasBase. It now |
| 22 | + returns int instead of float. |
24 | 23 |
|
25 | 24 | API Changes in matplotlib-0.82 |
26 | 25 |
|
27 | | - = toolbar import change in GTKAgg, GTKCairo and WXAgg = |
| 26 | + - toolbar import change in GTKAgg, GTKCairo and WXAgg |
28 | 27 |
|
29 | | - Added subplot config tool to GTK* backends -- note you must now |
30 | | - import the NavigationToolbar2 from your backend of choice rather |
31 | | - than from backend_gtk because it needs to know about the backend |
32 | | - specific canvas -- see examples/embedding_in_gtk2.py. Ditto for wx |
33 | | - backend -- see examples/embedding_in_wxagg.py |
| 28 | + - Added subplot config tool to GTK* backends -- note you must now |
| 29 | + import the NavigationToolbar2 from your backend of choice rather |
| 30 | + than from backend_gtk because it needs to know about the backend |
| 31 | + specific canvas -- see examples/embedding_in_gtk2.py. Ditto for |
| 32 | + wx backend -- see examples/embedding_in_wxagg.py |
34 | 33 |
|
35 | 34 |
|
36 | | - = hist bin change = |
| 35 | + - hist bin change |
37 | 36 |
|
38 | | - Sean Richards notes there was a problem in the way we created the |
39 | | - binning for histogram, which made the last bin underrepresented. |
40 | | - From his post |
| 37 | + Sean Richards notes there was a problem in the way we created |
| 38 | + the binning for histogram, which made the last bin |
| 39 | + underrepresented. From his post: |
41 | 40 |
|
42 | | - I see that hist uses the linspace function to create the bins and |
43 | | - then uses searchsorted to put the values in their correct |
44 | | - bin. Thats all good but I am confused over the use of linspace for |
45 | | - the bin creation. I wouldn't have thought that it does what is |
46 | | - needed, to quote the docstring it creates a "Linear spaced array |
47 | | - from min to max". For it to work correctly shouldn't the values in |
48 | | - the bins array be the same bound for each bin? (i.e. each value |
49 | | - should be the lower bound of a bin). To provide the correct bins |
50 | | - for hist would it not be something like |
| 41 | + I see that hist uses the linspace function to create the bins |
| 42 | + and then uses searchsorted to put the values in their correct |
| 43 | + bin. Thats all good but I am confused over the use of linspace |
| 44 | + for the bin creation. I wouldn't have thought that it does |
| 45 | + what is needed, to quote the docstring it creates a "Linear |
| 46 | + spaced array from min to max". For it to work correctly |
| 47 | + shouldn't the values in the bins array be the same bound for |
| 48 | + each bin? (i.e. each value should be the lower bound of a |
| 49 | + bin). To provide the correct bins for hist would it not be |
| 50 | + something like |
51 | 51 |
|
52 | | - def bins(xmin, xmax, N): |
53 | | - if N==1: return xmax |
54 | | - dx = (xmax-xmin)/N # instead of N-1 |
55 | | - return xmin + dx*arange(N) |
56 | | - |
| 52 | + def bins(xmin, xmax, N): |
| 53 | + if N==1: return xmax |
| 54 | + dx = (xmax-xmin)/N # instead of N-1 |
| 55 | + return xmin + dx*arange(N) |
57 | 56 |
|
58 | | - This suggestion in implemented in 0.81. My test script with these |
59 | | - changes does not reveal any bias in the binning |
60 | 57 |
|
61 | | - from matplotlib.numerix.mlab import randn, rand, zeros, Float |
62 | | - from matplotlib.mlab import hist, mean |
| 58 | + This suggestion is implemented in 0.81. My test script with these |
| 59 | + changes does not reveal any bias in the binning |
63 | 60 |
|
64 | | - Nbins = 50 |
65 | | - Ntests = 200 |
66 | | - results = zeros((Ntests,Nbins), typecode=Float) |
67 | | - for i in range(Ntests): |
68 | | - print 'computing', i |
69 | | - x = rand(10000) |
70 | | - n, bins = hist(x, Nbins) |
71 | | - results[i] = n |
72 | | - print mean(results) |
| 61 | + from matplotlib.numerix.mlab import randn, rand, zeros, Float |
| 62 | + from matplotlib.mlab import hist, mean |
73 | 63 |
|
| 64 | + Nbins = 50 |
| 65 | + Ntests = 200 |
| 66 | + results = zeros((Ntests,Nbins), typecode=Float) |
| 67 | + for i in range(Ntests): |
| 68 | + print 'computing', i |
| 69 | + x = rand(10000) |
| 70 | + n, bins = hist(x, Nbins) |
| 71 | + results[i] = n |
| 72 | + print mean(results) |
74 | 73 |
|
75 | 74 |
|
76 | 75 | API CHANGES in matplotlib-0.81 |
77 | 76 |
|
| 77 | + - pylab and artist "set" functions renamed to setp to avoid clash |
| 78 | + with python2.4 built-in set. Current version will issue a |
| 79 | + deprecation warning which will be removed in future versions |
78 | 80 |
|
79 | | - pylab and artist "set" functions renamed to setp to avoid clash with |
80 | | - python2.4 built-in set. Current version will issue a deprecation |
81 | | - warning which will be removed in future versions |
| 81 | + - imshow interpolation arguments changes for advanced interpolation |
| 82 | + schemes. See help imshow, particularly the interpolation, |
| 83 | + filternorm and filterrad kwargs |
82 | 84 |
|
83 | | - imshow interpolation arguments changes for advanced interpolation |
84 | | - schemes. See help imshow, particularly the interpolation, |
85 | | - filternorm and filterrad kwargs |
| 85 | + - Support for masked arrays has been added to the plot command and |
| 86 | + to the Line2D object. Only the valid points are plotted. A |
| 87 | + "valid_only" kwarg was added to the get_xdata() and get_ydata() |
| 88 | + methods of Line2D; by default it is False, so that the original |
| 89 | + data arrays are returned. Setting it to True returns the plottable |
| 90 | + points. |
86 | 91 |
|
87 | | - Support for masked arrays has been added to the plot command and to |
88 | | - the Line2D object. Only the valid points are plotted. A |
89 | | - "valid_only" kwarg was added to the get_xdata() and get_ydata() |
90 | | - methods of Line2D; by default it is False, so that the original data |
91 | | - arrays are returned. Setting it to True returns the plottable |
92 | | - points. |
| 92 | + - contour changes: |
93 | 93 |
|
94 | | - contour changes: |
| 94 | + Masked arrays: contour and contourf now accept masked arrays as |
| 95 | + the variable to be contoured. Masking works correctly for |
| 96 | + contour, but a bug remains to be fixed before it will work for |
| 97 | + contourf. The "badmask" kwarg has been removed from both |
| 98 | + functions. |
95 | 99 |
|
96 | | - Masked arrays: contour and contourf now accept masked arrays as the |
97 | | - variable to be contoured. Masking works correctly for contour, |
98 | | - but a bug remains to be fixed before it will work for contourf. |
99 | | - The "badmask" kwarg has been removed from both functions. |
| 100 | + Level argument changes: |
100 | 101 |
|
101 | | - Level argument changes: |
| 102 | + Old version: a list of levels as one of the positional |
| 103 | + arguments specified the lower bound of each filled region; the |
| 104 | + upper bound of the last region was taken as a very large |
| 105 | + number. Hence, it was not possible to specify that z values |
| 106 | + between 0 and 1, for example, be filled, and that values |
| 107 | + outside that range remain unfilled. |
102 | 108 |
|
103 | | - Old version: a list of levels as one of the positional arguments |
104 | | - specified the lower bound of each filled region; the upper bound |
105 | | - of the last region was taken as a very large number. Hence, it |
106 | | - was not possible to specify that z values between 0 and 1, for |
107 | | - example, be filled, and that values outside that range remain |
108 | | - unfilled. |
| 109 | + New version: a list of N levels is taken as specifying the |
| 110 | + boundaries of N-1 z ranges. Now the user has more control over |
| 111 | + what is colored and what is not. Repeated calls to contourf |
| 112 | + (with different colormaps or color specifications, for example) |
| 113 | + can be used to color different ranges of z. Values of z |
| 114 | + outside an expected range are left uncolored. |
109 | 115 |
|
110 | | - New version: a list of N levels is taken as specifying the |
111 | | - boundaries of N-1 z ranges. Now the user has more control over |
112 | | - what is colored and what is not. Repeated calls to contourf |
113 | | - (with different colormaps or color specifications, for example) |
114 | | - can be used to color different ranges of z. Values of z outside |
115 | | - an expected range are left uncolored. |
116 | | - |
117 | | - Example: |
118 | | - Old: contourf(z, [0, 1, 2]) would yield 3 regions: 0-1, 1-2, and >2. |
119 | | - New: it would yield 2 regions: 0-1, 1-2. If the same 3 regions were |
120 | | - desired, the equivalent list of levels would be [0, 1, 2, 1e38]. |
121 | | - |
122 | | - |
123 | | - |
| 116 | + Example: |
| 117 | + Old: contourf(z, [0, 1, 2]) would yield 3 regions: 0-1, 1-2, and >2. |
| 118 | + New: it would yield 2 regions: 0-1, 1-2. If the same 3 regions were |
| 119 | + desired, the equivalent list of levels would be [0, 1, 2, |
| 120 | + 1e38]. |
124 | 121 |
|
125 | 122 |
|
126 | 123 | API CHANGES in matplotlib-0.80 |
127 | 124 |
|
128 | | - xlim/ylim/axis always return the new limits regardless of arguments. |
129 | | - They now take kwargs which allow you to selectively change the upper |
130 | | - or lower limits while leaving unnamed limits unchanged. See |
131 | | - help(xlim) for example |
| 125 | + - xlim/ylim/axis always return the new limits regardless of |
| 126 | + arguments. They now take kwargs which allow you to selectively |
| 127 | + change the upper or lower limits while leaving unnamed limits |
| 128 | + unchanged. See help(xlim) for example |
132 | 129 |
|
133 | 130 | API CHANGES in matplotlib-0.73 |
134 | 131 |
|
135 | | - Removed deprecated ColormapJet and friends |
| 132 | + - Removed deprecated ColormapJet and friends |
136 | 133 |
|
137 | | - Removed all error handling from the verbose object |
| 134 | + - Removed all error handling from the verbose object |
138 | 135 |
|
139 | | - figure num of zero is now allowed |
| 136 | + - figure num of zero is now allowed |
140 | 137 |
|
141 | 138 | API CHANGES in matplotlib-0.72 |
142 | 139 |
|
143 | | - Line2D, Text, and Patch copy_properties renamed update_from and |
144 | | - moved into artist base class |
| 140 | + - Line2D, Text, and Patch copy_properties renamed update_from and |
| 141 | + moved into artist base class |
145 | 142 |
|
146 | | - LineCollecitons.color renamed to LineCollections.set_color for |
147 | | - consistency with set/get introspection mechanism, |
| 143 | + - LineCollecitons.color renamed to LineCollections.set_color for |
| 144 | + consistency with set/get introspection mechanism, |
148 | 145 |
|
149 | | - pylab figure now defaults to num=None, which creates a new figure |
150 | | - with a guaranteed unique number |
| 146 | + - pylab figure now defaults to num=None, which creates a new figure |
| 147 | + with a guaranteed unique number |
151 | 148 |
|
152 | | - contsour method syntax changed - now it is matlab compatible |
| 149 | + - contour method syntax changed - now it is matlab compatible |
153 | 150 |
|
154 | | - unchanged: contour(Z) |
155 | | - old: contour(Z, x=Y, y=Y) |
156 | | - new: contour(X, Y, Z) |
| 151 | + unchanged: contour(Z) |
| 152 | + old: contour(Z, x=Y, y=Y) |
| 153 | + new: contour(X, Y, Z) |
157 | 154 |
|
158 | | - see http://matplotlib.sf.net/matplotlib.pylab.html#-contour |
| 155 | + see http://matplotlib.sf.net/matplotlib.pylab.html#-contour |
159 | 156 |
|
160 | 157 |
|
161 | | - Increased the default resolution for save command. |
| 158 | + - Increased the default resolution for save command. |
162 | 159 |
|
163 | | - Renamed the base attribute of the ticker classes to _base to avoid conflict |
164 | | - with the base method. Sitt for subs |
| 160 | + - Renamed the base attribute of the ticker classes to _base to avoid conflict |
| 161 | + with the base method. Sitt for subs |
165 | 162 |
|
166 | | - subs=none now does autosubbing in the tick locator. |
| 163 | + - subs=none now does autosubbing in the tick locator. |
167 | 164 |
|
168 | | - New subplots that overlap old will delete the old axes. If you do |
169 | | - not want this behavior, use fig.add_subplot or the axes command |
| 165 | + - New subplots that overlap old will delete the old axes. If you |
| 166 | + do not want this behavior, use fig.add_subplot or the axes |
| 167 | + command |
170 | 168 |
|
171 | 169 | API CHANGES in matplotlib-0.71 |
172 | 170 |
|
|
0 commit comments