From: Alan G I. <ai...@am...> - 2005-07-09 18:40:31
|
On Sat, 09 Jul 2005, John Hunter apparently wrote: > It's pretty trivial to iterate over your list and call axvspan > repeatedly. Absolutely. I saw this purely as a nice user convenience. I was not even thinking about the performance aspect, which you mention. > Now if you have a long list of min/max values, you'll get > into performance issues since axvspan creates a new > rectangle for each min/max pair. To handle this case, we > would need to use a PolygonCollection (axvspans?) I would > suggest [ (xmin1, xmax2), (xmin1, xmin2), ...] as a more > natural data structure for the argument. Yes, I considered that because of its naturalness but went for conciseness. (I also had in the back of my mind that you might one day accept datetime.date compatible tuples as arguments, and typing tuples of tuples seemed error prone.) Either is great. > Is this a common need? Pretty common in macroeconomics. E.g., highlight the recession periods for some time series. However, given what you have said, I should add that I cannot think of an example with a *long* list of values. Cheers, Alan |