Hello --

When I run the following code (heavily adapted from the matplotlib examples):

...
SCHistogram = Figure(figsize=(6,6), dpi=300, facecolor='w') # 6 inches across 
(X-axis) by 4 inches tall (Y-axis)
ax = SCHistogram.add_subplot(111)

canvas = FigureCanvas(SCHistogram)

AxisTitleFontProps = FontProperties(size=10, family='serif')
AxisTitleFontProps.set_name('Times')

n, bins, patches = ax.hist(DimensionData)

y = normpdf( bins, self.meanVal, self.stdDev)
line, = ax.plot(bins, y, 'r--')
line.set_linewidth(1)

ax.set_xlabel(self.Description, fontproperties=AxisTitleFontProps)
ax.set_ylabel('Number of Parts' ,fontproperties=AxisTitleFontProps)
ax.set_xlim([x_lowest, x_highest])
ax.plot([self.LCL,self.LCL],[0,max(n)],'b--')
ax.plot([self.Nom,self.Nom],[0,max(n)],'g--')
ax.plot([self.UCL,self.UCL],[0,max(n)],'r--')
.
.
.

AxisTickFontProps = copy.deepcopy(AxisTitleFontProps)
AxisTickFontProps.set_size(7)

canvas.draw()

s = canvas.tostring_rgb()  # save this and convert to bitmap as needed

The following error appears when run under matplotlib 1.1 (the code 
successfully completes in v1.0.1):

Traceback (most recent call last):
  File "./analyze.pyw", line 681, in fileGenerateReport
    SPC_PDF.Generate()
  File "/Users/engelsma/dev/SPC_Analyzer/trunk/1.0.10/report.py", line 201, in 
Generate
    eachSC.CreateHistogram(eachSC.TempImgFile)
  File "/Users/engelsma/dev/SPC_Analyzer/trunk/1.0.10/SPCmodules.py", line 318, 
in CreateHistogram
    s = canvas.tostring_rgb()  # save this and convert to bitmap as needed
  File 
"/Users/engelsma/.virtualenvs/cmm/lib/python2.7/site-packages/matplotlib/backends/backend_agg.py",
 line 418, in tostring_rgb
    return self.renderer.tostring_rgb()
AttributeError: 'FigureCanvasQTAgg' object has no attribute 'renderer'

Any ideas as to why this code fails under v1.1? I've checked the changelog and 
I see nothing that would cause this problem... 

Thanks in advance, 

Dave Engelsma




------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing 
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to