On Mar 2, 7:02 am, "John Henry" <[EMAIL PROTECTED]> wrote: > On Mar 1, 10:07 pm, "John Henry" <[EMAIL PROTECTED]> wrote: > > > > > On Mar 1, 9:53 pm, [EMAIL PROTECTED] wrote: >
(snipped) > > > You can try adjusting the labels and ticks > > > using matplotlib.ticker. > > > > To the example you cited, one can add > > > > from matplotlib.ticker import MultipleLocator, FormatStrFormatter > > > > # ... > > > > minorLocator = MultipleLocator(0.1) > > > minorFormattor = FormatStrFormatter('%0.1f') > > > ax.yaxis.set_minor_locator(minorLocator) > > > ax.yaxis.set_minor_formatter(minorFormattor) > > > > show() > > > > Thank you for the response. Yes, adding those lines did work. > > > But what exactly is going on here? Why would adding these two lines > > works? > > > Thanks, > > Okay, I played with the ticker formater and locator routines. > Unfortunately, it doesn't help. The locator sets the major value and > the formatter determines how the axes label is formatted. It doesn't > gurantee that the first label starts at the origin. Half of my plots > works, and half of them doesn't. As default, matplotlib places labels and tick marks at major ticks. Minor ticks are invisible as a default. The lines that I added turned on *minor* ticks and their labels; I set them to appear at integer multiples of 0.1 and I formatted them as floating point numbers. There's nothing to prevent you from having minor ticks appear at intervals that exceed those of major ticks. E.g., minorLocator = MultipleLocator(1.1) # etc. -- Hope this helps, Steven -- http://mail.python.org/mailman/listinfo/python-list