Skip to content

imshow draws half of the first and last lines #15154

@anki-code

Description

@anki-code

Hello! I've updated matplotlib to the latest version (3.1.1) and got an issue: imshow draws half of the first and last lines when I use set_yticks.

Example:

import numpy as np
from matplotlib import pyplot as plt

oneDim = np.array([0.5,1,2.5,3.7])
twoDim = np.random.rand(8,4)

plt.figure(figsize=(twoDim.shape[1]/2,twoDim.shape[0]/2))
ax = plt.gca()

ax.imshow(twoDim, cmap='Purples', interpolation='nearest', aspect='auto')
ax.set_xticks(np.arange(0,twoDim.shape[1],1))
ax.set_yticks(np.arange(0,twoDim.shape[0],1))
ax.set_yticklabels(np.arange(0,twoDim.shape[0],1))
ax.grid()

Result:
image

How I can back to full square in line instead of the half?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions