From: Michael D. <md...@st...> - 2008-06-05 18:32:54
|
Thanks. That's a good argument to do the close for fill(). I'll wait a bit to see if others chime in, but at least at that level it seems to be a no-brainer. Whether we want to do this in the Polygon patch is still an open question, perhaps. Cheers, Mike Eric Firing wrote: > Eric Firing wrote: >> Michael Droettboom wrote: >>> I'm not entirely certain this is desirable behavior -- what if the >>> user *wants* to draw an open-yet-filled polygon? How could that be >>> done? (Admittedly, it couldn't be done before). It seems more >>> general to require the user to close polygons. >> >> True. I don't feel strongly about this. My guess is that at least >> at the level of the Axes.fill method, a user would almost never want >> the open-yet-filled case, but I could be guessing wrong, or the >> "almost" qualifier could be critical. We could do automatic closing >> only at that level, however. >> >> Maybe the best alternative is to leave the trunk behavior as it is, >> and make sure the documentation is very explicit about the need to >> supply a closed path. This change could be added to API_CHANGES, as >> well as to the Axes.fill docstring. >> >> Does anyone know how Matlab, IDL, etc. handle this? > > Here is the Matlab help text; matlab does automatically close the > polygons: > > fill(X,Y,C) creates filled polygons from the data in X and Y with > vertex color specified by C. C is a vector or matrix used as an index > into the colormap. If C is a row vector, length(C) must equal > size(X,2) and size(Y,2); if C is a column vector, length(C) must equal > size(X,1) and size(Y,1). If necessary, fill closes the polygon by > connecting the last vertex to the first. > > Eric -- Michael Droettboom Science Software Branch Operations and Engineering Division Space Telescope Science Institute Operated by AURA for NASA |