From: Serial <serial.null@oe...>  20060526 15:23:08

Hello, I don't know if I'm doing something wrong or if there is a bug somewhere... I have a graph with y values in ]0;1[, and associated standard deviations in ]0.01;0.3[ . What I want to do, of course, is to display these values with some error bars representing the standard deviations. I perfectly succeed generating a valid .pdf file when both axis are linears, but obtain various error messages when trying to open this file with different softwares when both axis are logarithmic ("There was an error processing a page. Too few operands", "An unrecognized token 'nan' was found"). Am I doing something wrong !? Aurelien 
From: Andre Wobst <wobsta@us...>  20060526 15:37:52

Hi, On 26.05.06, Serial wrote: > I don't know if I'm doing something wrong or if there is a bug > somewhere... I have a graph with y values in ]0;1[, and associated > standard deviations in ]0.01;0.3[ . What I want to do, of course, is > to display these values with some error bars representing the > standard deviations. > > I perfectly succeed generating a valid .pdf file when both axis are > linears, but obtain various error messages when trying to open this > file with different softwares when both axis are logarithmic ("There > was an error processing a page. Too few operands", "An unrecognized > token 'nan' was found"). > > Am I doing something wrong !? I'm not sure. It might be that you're trying to access a position on a logarithmic axis for a negative value. Depending on the system this might result in NaN's in the output. (The behaviour of log(1) is maschine dependend. On my PowerBook a math.log(1) returns "nan" while it creates a math domain error on my IA32 Debian box ...) Can you provide us with an example code, where this problem occurs? Alternatively you can insert a test in the convert method of pyx.graph.axis.axis.logarithmic and test for negative values ... André  by _ _ _ Dr. André Wobst / \ \ / ) wobsta@..., http://www.wobsta.de/ / _ \ \/\/ / PyX  High quality PostScript and PDF figures (_/ \_)_/\_/ with Python & TeX: visit http://pyx.sourceforge.net/ 
From: Serial <serial.null@oe...>  20060526 15:49:20

Hello, > Sounds like you failed to bound your values away from zero, > despite what you say above. > > A minimal example is helpful if you want a better answer. I did it in my first email but had to remove it as SourceForge rejected the attachments I sent :\ Anyway, I think you're right ; I have a value to plot, for example, with y = 0.0014 and a dy = 0.015. In logarithmic scale the coordinates of the error bar's ticks will be then, I guess y + dy and y  dy, i.e. something below 0 in the second case. Is there a way to force the display of these ticks, at least the ones that can be drawn ? Aurelien 
From: Andre Wobst <wobsta@us...>  20060526 16:22:20

Hi, On 26.05.06, Serial wrote: > >Sounds like you failed to bound your values away from zero, > >despite what you say above. > > > >A minimal example is helpful if you want a better answer. > > I did it in my first email but had to remove it as SourceForge > rejected the attachments I sent :\ It rejected a 300 KB PDF attachment ... which is obviously a Good Thing (tm). > Anyway, I think you're right ; I > have a value to plot, for example, with y = 0.0014 and a dy = 0.015. > In logarithmic scale the coordinates of the error bar's ticks will be > then, I guess y + dy and y  dy, i.e. something below 0 in the second > case. Is there a way to force the display of these ticks, at least > the ones that can be drawn ? IIRC you could do that by raising an ArithmeticError in the convert method of the log axis for zero and negative value. Or try and return a None for that case. Both should work. Note that you don't need to modify something in the PyX core to try that. Something along the lines: class mylogaxis(graph.axis.log): def convert(self, x): if x <= 0: return None return graph.axis.log.convert(self, x) g = graphxy(..., y=mylogaxis(), ...) should do. I have not tried that (an running example would certainly lowered the threshould to do so) but something along this lines should work. Note this should result in a removal of the negative bounds of the errorbars. (At least that's what I would expect to happen.) On a Intel PC this might even be the behaviour without any modifications due to the MathDomainError ... I'm not quite sure, but I guess so ... André  by _ _ _ Dr. André Wobst / \ \ / ) wobsta@..., http://www.wobsta.de/ / _ \ \/\/ / PyX  High quality PostScript and PDF figures (_/ \_)_/\_/ with Python & TeX: visit http://pyx.sourceforge.net/ 
From: Serial <serial.null@oe...>  20060526 16:33:39

> It rejected a 300 KB PDF attachment ... which is obviously a Good > Thing (tm). I agree ! Sorry for that. > Note that you don't need to modify something in the PyX core to try > that. Something along the lines: [...] Thank you ! This piece of code will do the trick. And Alan Isaac is right: I realize that my dy is larger than expected due to a bug in the software pipeline that generate the values. So, a big thanks for you both ;) Aurelien 
From: Alan G Isaac <aisaac@am...>  20060526 15:38:23

On Fri, 26 May 2006, Serial apparently wrote:=20 > =09I don't know if I'm doing something wrong or if there is a bug=20 > somewhere... I have a graph with y values in ]0;1[, and associated=20 > standard deviations in ]0.01;0.3[ . What I want to do, of course, is=20 > to display these values with some error bars representing the=20 > standard deviations.=20 > =09I perfectly succeed generating a valid .pdf file when both axis are=20 > linears, but obtain various error messages when trying to open this=20 > file with different softwares when both axis are logarithmic ("There=20 > was an error processing a page. Too few operands", "An unrecognized=20 > token 'nan' was found").=20 Sounds like you failed to bound your values away from zero, despite what you say above. A minimal example is helpful if you want a better answer. Cheers, Alan Isaac 
From: Alan G Isaac <aisaac@am...>  20060526 16:18:54

On Fri, 26 May 2006, Serial apparently wrote: > SourceForge rejected the attachments I sent You can just paste code into your email. > I think you're right ; I have a value to plot, for > example, with y = 0.0014 and a dy = 0.015. In logarithmic > scale the coordinates of the error bar's ticks will be > then, I guess y + dy and y  dy, i.e. something below 0 in > the second case. Is there a way to force the display of > these ticks, at least the ones that can be drawn ? Perhaps you have a bigger problem: it sounds like there is a conceptual difficulty in the data. Can y sensibly fall below zero, as the error bar suggests? But anyway, rather than ask PyX to handle the perverse values, you probably need to clean (delete problem values) or adjust (rescale) the data. Cheers, Alan Isaac 
From: Andre Wobst <wobsta@us...>  20060526 16:34:57

Hi, On 26.05.06, Alan G Isaac wrote: > > I think you're right ; I have a value to plot, for > > example, with y = 0.0014 and a dy = 0.015. In logarithmic > > scale the coordinates of the error bar's ticks will be > > then, I guess y + dy and y  dy, i.e. something below 0 in > > the second case. Is there a way to force the display of > > these ticks, at least the ones that can be drawn ? > > Perhaps you have a bigger problem: > it sounds like there is a conceptual difficulty in the data. > Can y sensibly fall below zero, as the error bar suggests? > > But anyway, rather than ask PyX to handle the perverse > values, you probably need to clean (delete problem values) > or adjust (rescale) the data. Beside my perverse suggestion to modify PyX's logaxis Alan is totally right! :) André PS: Still, we do have a problem with NaN's in PyX output. The logaxis is only a very single case where such a problem can arise from. And I think it's in the TODO section of the CHANGES for ages. I basically don't know how to properly handle that ... :(  by _ _ _ Dr. André Wobst / \ \ / ) wobsta@..., http://www.wobsta.de/ / _ \ \/\/ / PyX  High quality PostScript and PDF figures (_/ \_)_/\_/ with Python & TeX: visit http://pyx.sourceforge.net/ 