Pierre GM wrote: > All, > I need to plot stripes of different widths at different locations along the x > axis, but spanning the whole range of y data. Using axvspan in a loop works > quite fine. However, I was wondering whether it wouldn't be more efficient to > build a PatchCollection. > BrokenBarHCollection could be a candidate, but I have trouble figuring how to > force the bars to span the whole range of y: is it possible to force the > ordinates to axes coordinates ? > Thanks a lot in advance for any idea/comment
I haven't tried it, but I think you can use the same trick that axvspan uses: trans = blend_xy_sep_transform( self.transData, self.transAxes ) where "self" in this case is the axes instance, so you would use "ax" or whatever. Then, since the collection is an artist, you can use its inherited set_transform(trans) method, and specify your x coordinates in data units and your y as 0 and 1 to span the whole vertical extent. This is assuming you want the width of your bars to be in data coordinates, not just the x-positions of their centers. Eric > P. > > ------------------------------------------------------------------------- > This SF.net email is sponsored by DB2 Express > Download DB2 Express C - the FREE version of DB2 express and take > control of your XML. No limits. Just data. Click to get it now. > http://sourceforge.net/powerbar/db2/ > _______________________________________________ > Matplotlib-users mailing list > Matplotlib-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/matplotlib-users ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users