@@ -281,14 +281,11 @@ def renderTo(self, plot, dest):
281281 raster graphics formats.
282282
283283 :param qwt.plot.QwtPlot plot: Plot widget
284- :param str fileName: Path of the file, where the document will be stored
285- :param str format: Format for the document
286- :param QSizeF sizeMM: Size for the document in millimeters.
287- :param int resolution: Resolution in dots per Inch (dpi)
284+ :param dest: QPaintDevice, QPrinter or QSvgGenerator instance
288285
289286 .. seealso::
290287
291- :py:meth:`renderTo()`, :py:meth:` render()`,
288+ :py:meth:`render()`,
292289 :py:meth:`qwt.painter.QwtPainter.setRoundingAlignment()`
293290 """
294291 if isinstance (dest , QPaintDevice ):
@@ -308,6 +305,8 @@ def renderTo(self, plot, dest):
308305 rect .setRect (0 , 0 , dest .width (), dest .height ())
309306 if rect .isEmpty ():
310307 rect .setRect (0 , 0 , 800 , 600 )
308+ else :
309+ raise TypeError ("Unsupported destination type %s" % type (dest ))
311310 p = QPainter (dest )
312311 self .render (plot , p , rect )
313312
@@ -501,7 +500,7 @@ def renderScale(self, plot, painter, axisId, startDist, endDist,
501500 y = rect .bottom () - 1.0 - baseDist
502501 w = rect .width () - startDist - endDist
503502 align = QwtScaleDraw .TopScale
504- elif axisId == QwtPlot .xBottom :
503+ else : # QwtPlot.xBottom
505504 x = rect .left () + startDist
506505 y = rect .top () + baseDist
507506 w = rect .width () - startDist - endDist
0 commit comments