Because collections have verts and offsets, which may have
> separate transformations, it is not possible, in general, to
> convert the plotted points to data units (which is what we
> would need) until the viewLim is set; but that defeats the
> purpose, which is to update the dataLim so that it can be
> used to calculate viewLim.
Hey Eric, thanks for laying out the problem so clearly. The only way
for different transforms (eg the vert and offset transform) to
coordinate is to first convert to the common space (display/pixels)
and then invert back to their respective coordinates. And this isn't
possible if the viewlim aren't set, as you note. It's been a while
since I mucked around with the get_verts method in the collections
module, but I had the feeling that I had left it incomplete and your
post clarifies that.
> The related bug is that the collection get_verts() methods
> all simply add the offset to the verts and return the sums,
> which are quite meaningless unless transform and transOffset
> are identical; and even if they are identical, the units of
> get_verts() will depend on the transform.
> Options for adding some automatic dataLim updating option to
> add_collection include:
> 1) Don't even try. Simply require it to be done manually.
> Make notes in docstrings and/or elsewhere.
> 3) Do a partial job of it also in the case where transData
I think we can support auto-limits for collections reasonably
coherently. I'm inclined to leave the default behavior unchanged for
efficiency (no auto-limits) but to support a kwarg that does
def add_collection(self, coll, autolim=False)
...or something to that effect.
If autolim is True, even given the problems you pointed out above, we
can support it in many common use cases.
There are two cases with no ambiguity that we could definitely support
* if no offsets are specified just use the verts
* if offsets are specified and the vert and offset transforms are
the same it is straightforward to calculate the limits
If offsets are defined, one could, as Chris suggested, just use the
offsets to compute the limits. This would be "close enough" to get
most of the data into the axes, and the user could then tweak to their
heart's content. In this case we might want to warn.