Issues with Circle

Hi,

I'm having issues with translucent patches. The following code

import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as mpl
from matplotlib.patches import Circle

fig = mpl.figure()
ax = fig.add_subplot(111)
c = Circle((0.25,0.5), radius=0.2, facecolor='none', edgecolor='green', alpha=0.2)
ax.add_patch(c)
c = Circle((0.75,0.5), radius=0.2, facecolor='blue', edgecolor='green', alpha=0.2)
ax.add_patch(c)
fig.savefig('test_alpha.png')

Produces a plot where the two circles have different borders - the left circle has a border with alpha=1.0 and the right circle has a border with alpha=0.2. Should I submit this as a bug report?

I am also having issues with the following script:

import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as mpl
from matplotlib.patches import Circle

import time

fig = mpl.figure()
ax = fig.add_subplot(111)
ax.add_patch(Circle((1.e10,1.e10), radius=1.e9))

time1 = time.time()

fig.savefig('test_perf.png')

print "Time to save: %.3f" % (time.time() - time1)

The issue is that the time to save is typically 3 seconds or so, up to 5 seconds in some caes (way more than normal), and the axes do not autoscale to show the patch (I imagine the two issues are related). Is this a bug, or just due to the way matplotlib works?

Thanks for any help,

Thomas

This is kind of a known bug.

http://old.nabble.com/patches-have-incorrect-alpha-values-td22667217.html#a22667217

But, please go ahead and file a bug report.

Fixing this requires some changes in backend api, and I'm not sure if
this will be fixed soon.

Regards,

-JJ

ยทยทยท

On Fri, Apr 23, 2010 at 11:07 AM, Thomas Robitaille <thomas.robitaille@...287...> wrote:

Hi,

I'm having issues with translucent patches. The following code

import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as mpl
from matplotlib.patches import Circle

fig = mpl.figure()
ax = fig.add_subplot(111)
c = Circle((0.25,0.5), radius=0.2, facecolor='none', edgecolor='green', alpha=0.2)
ax.add_patch(c)
c = Circle((0.75,0.5), radius=0.2, facecolor='blue', edgecolor='green', alpha=0.2)
ax.add_patch(c)
fig.savefig('test_alpha.png')

Produces a plot where the two circles have different borders - the left circle has a border with alpha=1.0 and the right circle has a border with alpha=0.2. Should I submit this as a bug report?