In the future, it would be sweet if these functions (or cousins of these functions) could be called directly on the trace objects themselves, sort of in Pandas like manner.