On Fri, May 6, 2011 at 10:33 AM, Benjamin Root <ben.r...@ou.edu> wrote: > On Thu, May 5, 2011 at 10:01 PM, C M <cmpyt...@gmail.com> wrote: >> >> > Because you have a py2exe'ed program, I suspect that whoever packaged >> > the >> > program should be the one to modify that program to choose its axes >> > limits >> > more robustly in order to avoid the warning message. >> >> Maybe I have been unclear. I am the sole developer of this >> application, and I occasionally test it as a py2exe'd app in >> anticipation of delivering it in that form at some point. I would be >> happy to modify the program to choose its axes limits more >> robustly--if I only knew how to do that. That is what I am asking. >> How should I do that? >> >> The data to be plotted is a very simple date plot with dates on the x >> axis and values (formatted as time) on the y axis. >> >> Che > > Most likely, somewhere in your code, you have a call to set_ylim(), and are > likely setting it to the minimum and maximum values of the data you are > plotting. This is where the problem comes in. There are several options to > go about avoiding the problem here. One is to not call set_ylim() at all if > you have only one data point, and just let matplotlib figure out the > y-limits automatically. Another approach is to call set_ylim() with > parameters that have an explicit amount of padding, like the following: > > ax.set_ylim(y.min() - 0.5, y.max() + 0.5) > > This way, you are guaranteed that the top and bottom limits will never be > the same. The best approach is up to you. > > I hope that helps! > Ben Root
Thank you, Ben! That helps a lot. Adding some padding myself seems to fix it. And it's good to understand what was occurring. -Che ------------------------------------------------------------------------------ WhatsUp Gold - Download Free Network Management Software The most intuitive, comprehensive, and cost-effective network management toolset available today. Delivers lowest initial acquisition cost and overall TCO of any competing solution. http://p.sf.net/sfu/whatsupgold-sd _______________________________________________ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users