ylabels offset in box and whisker plots

Any idea why this is happening?

Code...
    # Boxplot
    plt.clf()
    fig = matplotlib.pyplot.gcf()
    fig.set_size_inches(9,16)
    plt.rc('lines', **{'marker':None})
    plt.grid(True)
    data = r.copy()/100
    data = np.log10(data)
    data[np.isinf(data)] = np.nan
    idx = np.nanmedian(data.T, axis=0).argsort()
    data = data[idx, :]
    newGenii = []
    z = []
    for k in idx:
        newGenii.append(genii[k])
    for k in range(data.shape[0]):
        tmp = data.T[:,k]
        tmp = tmp[np.isfinite(tmp)]
        z.append(tmp)
    plt.boxplot(z, notch = False, vert = False, whis=[5,95], sym='')
    plt.yticks(np.arange(data.shape[0]), newGenii, size='xx-small')
    plt.xlabel('Log10 Abundance')
    plt.title('Genus -- Box and Whisker')
    plt.savefig(os.path.join(baseDir, 'box and whisker.png'))
    plt.close('all')

[image: Inline image 1]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/matplotlib-devel/attachments/20170606/8431101f/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: box and whisker.png
Type: image/png
Size: 1625342 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/matplotlib-devel/attachments/20170606/8431101f/attachment-0001.png>

Try to supply a self-contained [minimal working
example](Minimal reproducible example - Wikipedia). What
is happening that you don?t think should happen?

Cheers, Jody

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/matplotlib-devel/attachments/20170606/dbeb37f4/attachment.html&gt;

···

On 6 Jun 2017, at 6:41, Isaac Gerg wrote:

Any idea why this is happening?

Code...
    # Boxplot
    plt.clf()
    fig = matplotlib.pyplot.gcf()

I fixed it by adding 1 to the arange in yticks. No idea though why i need
this.

···

On Tue, Jun 6, 2017 at 11:58 AM, Jody Klymak <jklymak at uvic.ca> wrote:

On 6 Jun 2017, at 6:41, Isaac Gerg wrote:

Any idea why this is happening?

Code...
# Boxplot
plt.clf()
fig = matplotlib.pyplot.gcf()

Try to supply a self-contained minimal working example
<https://en.wikipedia.org/wiki/Minimal_Working_Example&gt;\. What is
happening that you don?t think should happen?

Cheers, Jody

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/matplotlib-devel/attachments/20170606/a4e424c7/attachment.html&gt;