SVG backend - edge alpha channel fix?

I'm using matplotlib v0.99.1.1 pyplot savefig() to generate svg files
using the matplotlib.use('SVG') backend. My networkx plot contains
semi-transparent edges which were not carrying over to the svg xml
correctly. The node transparencies were correct.
I was able to fix this problem by modifying
/matplotlib/backends/backend_svg.py ...

@@ -150 +149 @@
- gc.get_alpha(),
+ gc.get_rgb()[3],

While gc.get_rgb()[3] was able to return the correct alpha float
value, gc.get_alpha() was always returning 1.0.
Has anyone else seen this problem? Perhaps it's my use of
draw_networkx_edges() to style the edges.

Hope this helps,
Bob

I'm using matplotlib v0.99.1.1 pyplot savefig() to generate svg files
using the matplotlib.use('SVG') backend. My networkx plot contains
semi-transparent edges which were not carrying over to the svg xml
correctly. The node transparencies were correct.
I was able to fix this problem by modifying
/matplotlib/backends/backend_svg.py ...

@@ -150 +149 @@
- gc.get_alpha(),
+ gc.get_rgb()[3],

I don't think this is the right thing to do in general--as far as I can see, gc.get_rgb() can return an rgb triplet instead of an rgba quad.

While gc.get_rgb()[3] was able to return the correct alpha float
value, gc.get_alpha() was always returning 1.0.
Has anyone else seen this problem? Perhaps it's my use of
draw_networkx_edges() to style the edges.

No, I think it is part of some difficulties in alpha-handling that have been around for a long time, and that I hope I have solved--although most likely there are still glitches to be smoothed out.

Can you build from svn and see whether that solves the problem? If not, please provide a simplest-possible standalone script that illustrates the problem, so I can try running it from current mpl.

Eric

ยทยทยท

On 06/04/2010 07:46 AM, Bob wrote:

Hope this helps,
Bob