Re: [Matplotlib-users] Axes.stem() doesn't draw stemlines if yscale is logarithmic
This is a tricky one. It appears this bug also exists in 0.91.x, perhaps earlier as well, so it isn't a regression. I don't like the idea of setting the minimum to 1, especially for when the scale isn't log. Setting it to a really small positive value (like 1e-9) is better, but the autoscaling of the log plot then goes down to 1e-9 as well. Do any other developers have better suggestions? We may have to do some magic in at drawing time (or convince the autoscaler to ignore the stem lines) -- but I'd like to find a way that minimizes additional complexity. Cheers, Mike [EMAIL PROTECTED] wrote: Hello, I tried to do a stem plot on an Axes with logarithmic scale, experiencing that the stemlines were not drawn... axes.py (svn trunk, 2008-07-08): def stem(self, x, y, linefmt='b-', markerfmt='bo', basefmt='r-'): [...] stemlines = [] for thisx, thisy in zip(x, y): l, = self.plot([thisx,thisx], [0, thisy], linefmt) stemlines.append(l) After Axes.set_yscale('log'), Axes.stem() no longer draws the stemlines because it tries to draw from y=0, thereby apparently triggering some guard which prevents plotting log(0), hence suppressing the complete stemline. Dirty hacking, I replace [0, thisy] with [1, thisy] in case yscale=='log' and it works for my plots, but for sure there is more to do to make it robust... Please give me a heads-up if I just oversaw the Right Way to do a stem plot with logarithmic yscale. Cheers, Dirk - Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW! Studies have shown that voting for your favorite open source project, along with a healthy diet, reduces your potential for chronic lameness and boredom. Vote Now at http://www.sourceforge.net/community/cca08 ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- Michael Droettboom Science Software Branch Operations and Engineering Division Space Telescope Science Institute Operated by AURA for NASA - Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW! Studies have shown that voting for your favorite open source project, along with a healthy diet, reduces your potential for chronic lameness and boredom. Vote Now at http://www.sourceforge.net/community/cca08 ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Axes.stem() doesn't draw stemlines if yscale is logarithmic
Le lundi 14 juillet 2008 à 09:08 -0400, Michael Droettboom a écrit : Do any other developers have better suggestions? We may have to do some magic in at drawing time (or convince the autoscaler to ignore the stem lines) -- but I'd like to find a way that minimizes additional complexity. Is it possible do proceed as using axvline, i.e. specifying the axes coordinates? In this case, it would require a mix of data coordinate (the value to display) and of axes coordinate (the bottom of the curve). When would values to render be converted ? -- Fabrice Silva [EMAIL PROTECTED] LMA UPR CNRS 7051 - équipe S2M - Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW! Studies have shown that voting for your favorite open source project, along with a healthy diet, reduces your potential for chronic lameness and boredom. Vote Now at http://www.sourceforge.net/community/cca08 ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] Axes.stem() doesn't draw stemlines if yscale is logarithmic
Hello, I tried to do a stem plot on an Axes with logarithmic scale, experiencing that the stemlines were not drawn... axes.py (svn trunk, 2008-07-08): def stem(self, x, y, linefmt='b-', markerfmt='bo', basefmt='r-'): [...] stemlines = [] for thisx, thisy in zip(x, y): l, = self.plot([thisx,thisx], [0, thisy], linefmt) stemlines.append(l) After Axes.set_yscale('log'), Axes.stem() no longer draws the stemlines because it tries to draw from y=0, thereby apparently triggering some guard which prevents plotting log(0), hence suppressing the complete stemline. Dirty hacking, I replace [0, thisy] with [1, thisy] in case yscale=='log' and it works for my plots, but for sure there is more to do to make it robust... Please give me a heads-up if I just oversaw the Right Way to do a stem plot with logarithmic yscale. Cheers, Dirk - Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW! Studies have shown that voting for your favorite open source project, along with a healthy diet, reduces your potential for chronic lameness and boredom. Vote Now at http://www.sourceforge.net/community/cca08 ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users