@@ -11,7 +11,7 @@ viable.
1111Push the data to the backend only once, or only when required. Update
1212the transforms in the backend, but do not push transformed data on
1313every draw. This is potentially a major win, because we currently
14- move the data around on every draw. Eg see how mpl1.py handles pusing
14+ move the data around on every draw. Eg, see how mpl1.py handles pusing
1515the paths when the renderer is set (Figure.set_renderer) but on draw
1616commands (Figure.draw) only pushes the current affine.
1717
@@ -28,17 +28,22 @@ transformation from normalized figure units to display
2828
2929Do we want to use 3x3 or 4x4 to leave the door open for 3D developers?
3030
31+ How do transformations (linear and nonlinear) play wtih Axis features
32+ (ticking and gridding). The ideal is an framework in which ticking,
33+ gridding and labeling work intelligently with arbitrary
34+ transformations. What is the proper transformation API?
35+
3136= Objects that talk to the backend "primitives" =
3237
3338Have just a few, fairly rich obects, that the backends need to
3439understand. Clear candidates are a Path, Text and Image, but despite
35- similar names, don't confuse these with the current matplotlib Artists
36- by the same name , which are considerably higher level than what I'm
37- thinking of here. Each of these will carry their metadata, eg a path
38- will carry its stroke color, facecolor, linewidth, etc. Text will
39- carry its font size, color, etc. We may need some optimizations down
40- the road, but start small. For now, let's call these objects
41- "primitives".
40+ their similar names, don't confuse these with the current matplotlib
41+ eponymous matplotlib Artists , which are considerably higher level than
42+ what I'm thinking of here. Each of these will carry their metadata,
43+ eg a path will carry its stroke color, facecolor, linewidth, etc...,
44+ and Text will carry its font size, color, etc.... We may need some
45+ optimizations down the road, but we should start small. For now,
46+ let's call these objects "primitives".
4247
4348= Where do the plot functions live? =
4449
@@ -51,81 +56,85 @@ what should they create, etc?
5156Do we want to create high level objects like Circle, Rectangle and
5257Line, each of which manage a Path object under the hood? Probably,
5358for user convenience and general compability with matplotlib. By
54- using traits properly here, these will be thin interfaces around one
55- of our primitives. I think the whole collections module is poorly
56- designed, and should be chucked wholesale, if favor of faster, more
57- elegant, optimizations and special cases. Just having the right Path
58- object will reduce the need for many of these, eg LineCollection,
59+ using traits properly here, many current matplotlib Arists will be
60+ thin interfaces around one oer more primitives.
61+
62+ I think the whole matplotlib.collections module is poorly designed,
63+ and should be chucked wholesale, in favor of faster, more elegant,
64+ optimizations and special cases. Just having the right Path object
65+ will reduce the need for many of these, eg LineCollection,
5966PolygonCollection, etc... Also, everything should be numpy enabled,
60- and the list of python tuples approach that many of the collections
61- take should be shed .
67+ and the sequence-of- python- tuples approach that many of the
68+ collections take should be dropped .
6269
6370= Z-ordering, containers, etc =
6471
65- Peter has been doing a lot of nice work on z-order and layers and
66- stuff like that for chaco, stuff that looks really useful for picking,
67- interactive, etc... We should look at their approach, and think
68- carefully about how this should be handled. Paul may be a good
69- candidate for this, since he has been working on picking.
72+ Peter has been doing a lot of nice work on z-order and layers for
73+ chaco, stuff that looks really useful for picking, interaction, etc...
74+ We should look at this approach, and think carefully about how this
75+ should be handled. Paul may be a good candidate for this, since he
76+ has been working recently on picking.
7077
7178= Extension code =
7279
7380I would like to shed all of the CXX extension code -- it is just too
74- small a nitch of the python world to base our project on. SWIG is
81+ small a nitch in the python world to base our project on. SWIG is
7582pretty clearly the right choice. mpl1 will use numpy for
7683transformations with some carefully chosen extension code where
77- necessary, so this gets rid of _transforms.cpp. I also plan to use
78- the SWIG agg wrapper, so this gets rid of _backend_agg. If we can
79- enhance the SWIG agg wrapper, we can also do images through there.
80- Having a fully featured python exposed agg wrapper will be a plus.
81- But with the agg license change, I'm open to discussion of
82- alternatives .
84+ necessary, to get rid of _transforms.cpp. I also plan to use the SWIG
85+ agg wrapper, so this gets rid of _backend_agg. If we can enhance the
86+ SWIG agg wrapper, we can also do images through there, getting rid of
87+ _image.cpp. Having a fully featured, python- exposed agg wrapper will
88+ be a plus in mpl and beyond. But with the agg license change, I'm
89+ open to discussion of other approaches .
8390
8491I want to do away with *all* GUI extension code. This should live
85- outside MPL if at all, eg in a toolkit, if we need it. This means
86- someone needs to figure out how to get tk talking to a python buffer
87- object or numpy array. Maintaining the GUI extension code across
88- platforms is an unending headache.
92+ outside MPL if at all, eg in a toolkit if we need it. This means
93+ someone needs to figure out how to get TkInter talking to a python
94+ buffer object or a numpy array. Maintaining the GUI extension code
95+ across platforms is an unending headache.
8996
9097= Traits =
9198
9299I think we should make a major committment to traits and use them from
93- the ground up. Without the UI stuff, they add plenty to make them
94- worthwhile, especially the validation and notification features. With
95- the UI (wx only) , they are a major win for GUI developers. Compare
96- the logic for sharing an x-axis in matplotlib transforms with sharex
97- with the approach used in mpl1.py with synch-ed affines.
100+ the ground up. Even without the UI stuff, they add plenty to make
101+ them worthwhile, especially the validation and notification features.
102+ With the UI (wx only) , they are a major win for many GUI developers.
103+ Compare the logic for sharing an x-axis using matplotlib transforms
104+ with Axes.sharex with the approach used in mpl1.py with sync_trait-ed
105+ affines.
98106
99107= Axis handling =
100108
101- The whole conception of the Axes needs to be rethought, in light of
102- the fact that we need to support multiple axis objects on one Axes.
103- The matplotlib implementation assumes 1 xaxis and 1 yaxis per Axes,
104- and we hack two y-axis support with some transform shenanigans via
105- twinx, but the approach is not generalizable and is unwieldy.
109+ The whole concept of the Axes needs to be rethought, in light of the
110+ fact that we need to support multiple axis objects on one Axes. The
111+ matplotlib implementation assumes 1 xaxis and 1 yaxis per Axes, and we
112+ hack two y-axis support (examples/two_scales.py) with some transform
113+ shenanigans via twinx, but the approach is not generalizable and is
114+ unwieldy.
106115
107116This will require a fair amount of thought, but we should aim for
108117supporting an arbitrary number of axis obects, presumably associated
109- with individual artists or primitives, on each Axes . They also need
110- to be *much* faster. matplotlib uses Artists for each tick, tickline,
111- gridline, ticklabel, etc, and this is mind-numbingsly slow. I have
112- some proto-type axis implementations that draw all the ticks with a
113- single path using repeated MOVETO and LINETO, for example, which will
114- be incomparably faster, than using a separate object from each tick.
118+ with individual artists or primitives. They also need to be *much*
119+ faster. matplotlib uses Artists for each tick, tickline, gridline ,
120+ ticklabel, etc, and this is mind-numbingly slow. I have a prototype
121+ axis implementations that draws the ticks with a single path using
122+ repeated MOVETO and LINETO, for example, which will be incomparably
123+ faster than using a separate object for each tick.
115124
116125= Breakage =
117126
118127I think we need to be prepared to break the hell out of matplotlib.
119128The API will basically be a total rewrite. pylab will still mostly
120- work unchanged -- that is the beauty of pylab - though API calls on
121- return obects will probably be badly broken. We can mitigate this
122- pain if we desire with clever wrapper objects, but once you start
123- calling methods on return objects, you oin the community of power
124- users, and this is the community I'm most willing to inconvenience
125- with breakage. We'll probably want to install into a new namespace,
126- eg "mpl", and envision both matplotlib and mpl co-existing for some
127- time. In fact, mpl might depend on matplotlib initially ( eg until a
128- CXX free ft2font is available)
129+ work unchanged -- that is the beauty of pylab -- though API calls on
130+ return obects may be badly broken. We can mitigate this pain if we
131+ desire with clever wrapper objects, but once you start calling methods
132+ on return objects, you join the community of power users, and this is
133+ the community I'm most willing to inconvenience with breakage. We'll
134+ probably want to install into a new namespace, eg "mpl", and envision
135+ both matplotlib and mpl co-existing for some time. In fact, mpl might
136+ depend on matplotlib initially, eg until a CXX free ft2font is
137+ available.
129138
130139We should expect to be supporting and using matplotlib for a long
131140time, since the proposals discussed here imply that it will be a long
@@ -153,9 +162,9 @@ core, eg traits, increasing the possibility of synergies.
153162There is a legitimate need to be able to feed custom objects into
154163matplotlib. Recent versions of matplotlib support this with a unit
155164registry in the "units" module. A clear use case is plotting with
156- native datetime objects, which is supported in the latest release of
157- matplotlib via the unit handling, which should probably be called
158- "custom object handling and conversion". This is a deep and
159- complictaed subject, involving questions of where the original data
160- live, how they are converted to useful types (arrays of floats) etc.
161- It's worth thinking about as we discuss redesign issues.
165+ native datetime objects, which is supported in 0.90 via the unit
166+ handling, which should probably be called "custom object handling and
167+ conversion". This is a deep and complicated subject, involving
168+ questions of where the original data live, how they are converted to
169+ useful types (arrays of floats) etc. It's worth thinking this about
170+ as we discuss redesign issues.
0 commit comments