#48 PyX crashes when plotting constant values

closed
nobody
None
5
2012-10-16
2007-08-02
Claude
No

Bonjour,

My document is made of several pages, each of them including one or two plots coming from engineering data generated by a separate process.

It seems that PyX is not able to plot a set of values when they are in fact constant.
Maybe this is a known bug (cf. Mesg dated 2007-07-24 08:54 sent on pyx-devel by Michael).

Claude

Following is the traceback I get :

== Starts here ==

Traceback (most recent call last):
File "test.py", line 203, in <module>
test.writePDFfile("test")
File "/usr/lib/python2.5/site-packages/pyx/document.py", line 161, in writePDFfile
pdfwriter.PDFwriter(self, file, args, kwargs)
File "/usr/lib/python2.5/site-packages/pyx/pdfwriter.py", line 475, in init
catalog = PDFcatalog(document, self, registry)
File "/usr/lib/python2.5/site-packages/pyx/pdfwriter.py", line 155, in init
self.PDFpages = PDFpages(document, writer, registry)
File "/usr/lib/python2.5/site-packages/pyx/pdfwriter.py", line 212, in init
page = PDFpage(page, pageno, self, writer, registry)
File "/usr/lib/python2.5/site-packages/pyx/pdfwriter.py", line 238, in init
self.PDFcontent = PDFcontent(page, writer, self.pageregistry)
File "/usr/lib/python2.5/site-packages/pyx/pdfwriter.py", line 267, in init
page.processPDF(contentfile, writer, acontext, registry, self.bbox)
File "/usr/lib/python2.5/site-packages/pyx/document.py", line 141, in processPDF
self._process("processPDF",
args)
File "/usr/lib/python2.5/site-packages/pyx/document.py", line 81, in _process
getattr(self.canvas, processMethod)(canvasfile, writer, context, registry, bbox)
File "/usr/lib/python2.5/site-packages/pyx/canvas.py", line 215, in processPDF
item.processPDF(file, writer, context, registry, nbbox)
File "/usr/lib/python2.5/site-packages/pyx/graph/graph.py", line 161, in processPDF
self.finish()
File "/usr/lib/python2.5/site-packages/pyx/graph/graph.py", line 250, in finish
self.doaxes()
File "/usr/lib/python2.5/site-packages/pyx/graph/graph.py", line 472, in doaxes
self.dolayout()
File "/usr/lib/python2.5/site-packages/pyx/graph/graph.py", line 456, in dolayout
self.doaxiscreate(axisname)
File "/usr/lib/python2.5/site-packages/pyx/graph/graph.py", line 450, in doaxiscreate
self.axes[axisname].create()
File "/usr/lib/python2.5/site-packages/pyx/graph/axis/axis.py", line 565, in create
self.canvas = self.axis.create(self.data, self.positioner, self.graphtexrunner, self.errorname)
File "/usr/lib/python2.5/site-packages/pyx/graph/axis/axis.py", line 228, in create
return _regularaxis._create(self, data, positioner, graphtexrunner, self.parter, self.rater, errorname)
File "/usr/lib/python2.5/site-packages/pyx/graph/axis/axis.py", line 161, in _create
self.min is None, self.max is None)
File "/usr/lib/python2.5/site-packages/pyx/graph/axis/parter.py", line 149, in partfunctions
raise RuntimeError("partitioning failed due to empty or invalid axis range")
RuntimeError: partitioning failed due to empty or invalid axis range

== Ends here ==

Discussion

  • Michael Schindler

    Logged In: YES
    user_id=776868
    Originator: NO

    Bonjour Claude,

    This issue has now been fixed in the current SVN version (revision 2979) and will probably be in the next release. There is now an additional argument to the axis constructors graph.axis.linear and graph.axis.logarithmic, which can be used to guarantee a minimal axis range. You may want to set it as, for example

    g = graph.graphxy(width=10, x=graph.axis.lin(fallbackrange=1.0e-5))

    Please note that the feature of a fallback range is switched off by default! The reason for this is that there is no a-priori value for a good fallback range. You will therefore either use it in case you encounter the described error, or take the habit to switch it on in your PyX scripts.

    Cordialement,
    Michael

     
  • Andre Wobst

    Andre Wobst - 2008-03-26

    Logged In: YES
    user_id=405853
    Originator: NO

    closing as michael created a patch which was applied to the repository

     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks