From: Michael D. <md...@st...> - 2011-08-22 21:52:49
|
I'm tinkering with your example a little bit, but clicking on the legend items doesn't seem to do anything whether it contains the offending clipPath snippet or not. What version of matplotlib are you using? What browser (and version) are you using to interact with the SVG? Can you attach the SVG file (maybe in both working and broken states), so I can tinker with it? You may want to try moving the "<defs>" containing the clipPath up a level, so it is a peer with the histogram rectangles. That's just a stab in the dark. If that turns out that makes the difference, that should be an easy enough fix within matplotlib. Cheers, Mike On 08/22/2011 10:57 AM, David Huard wrote: > Hi, > > I'm trying to create an SVG figure that will show or hide the bars of > a histogram when clicking on the element in the legend. I got to the > point where it almost works... > > I'm including the script so that others can play with it, but from > what I understand, the problem is that the first histogram patch > definition includes a clipping path definition > > <defs> > <clipPath id="p7ff5b81e1d"> > <rect height="345.6" width="446.4" x="72.0" y="43.2" /> > </clipPath> > </defs> > > that is referenced by all other histogram patches. When setting the > visibility attribute of the first patch to "hidden" , it hides all > patches. > > If I remove this clipping path entirely (by hand), the interactive > components work as expected. > > This is my first foray in SVG so my approach is probably naive, but > I'd welcome suggestions to make this work. Having one clippath per > histogram item would simplify things, but I don't know the internals > of matplotlib well enough to do this elegantly. > > Thanks, > > David > > > ------------------------------------------------------------------------------ > uberSVN's rich system and user administration capabilities and model > configuration take the hassle out of deploying and managing Subversion and > the tools developers use with it. Learn more about uberSVN and get a free > download at: http://p.sf.net/sfu/wandisco-dev2dev > > > _______________________________________________ > Matplotlib-devel mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-devel |