Skip to content

Heatmaps are being truncated when using with seaborn #14675

Closed

Description

@mirage007

Bug report

Bug summary

The very top and bottom of the heatmaps are getting truncated to 1/2 height in version 3.1.1. This does not happen for version 3.0.3.

This is the code from a Jupyter Notebook

import matplotlib
import pandas as pd
import numpy as np
import seaborn as sb
%pylab inline

print(matplotlib.__version__)
print(sb.__version__)

grid = pd.DataFrame(np.arange(9).reshape((3,3))/10)
fig, ax = subplots(1, 1, figsize=(5, 5))

sb.heatmap(grid, annot=True, fmt=".0f", ax=ax, cmap='RdBu',  vmin=0, vmax=1, cbar=True);

Actual outcome

Populating the interactive namespace from numpy and matplotlib
3.1.1
0.9.0

download

Matplotlib version

  • Operating system: Ubuntu Linux
  • Matplotlib version: 3.1.1
  • Matplotlib backend: module://ipykernel.pylab.backend_inline
  • Python version: 3.6
  • Jupyter version (if applicable): 4.4.0
  • Other libraries:

Activity

  1. jklymak commented on Jul 2, 2019

    @jklymak
    Member

    It’s not clear what the issue is here. Can you also give the expected outcome? There have been changes to colorbar. Perhaps seaborn was doing something low level and the changes didn’t interact well with their manipulations

  2. ImportanceOfBeingErnest commented on Jul 2, 2019

    @ImportanceOfBeingErnest
    Member

    This is a regression between 3.1.0 and 3.1.1. It bisects to #14579

    Expected outcome would be
    image

  3. ImportanceOfBeingErnest commented on Jul 2, 2019

    @ImportanceOfBeingErnest
    Member

    Here is a pure matplotlib test case:

    import matplotlib
    import matplotlib.pyplot as plt
    import numpy as np
    
    data = np.arange(9).reshape((3,3))/10
    
    fig, ax = plt.subplots(1, 1, figsize=(3.5, 3.5))
    
    ax.pcolormesh(data)
    ax.set(xlim=(0, data.shape[1]), ylim=(0, data.shape[0]))
    
    ax.invert_yaxis()
    ax.set(xticks=np.arange(data.shape[1])+.5, 
           yticks=np.arange(data.shape[0])+.5)
    
    ax.set_title(matplotlib.__version__)
    plt.show()
    

    Actual outcome with 3.1.1

    image

    Expected outcome, as with 3.1.0

    image

  4. added this to the v3.1.2 milestone on Jul 2, 2019
  5. added
    Release criticalFor bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions.
    on Jul 2, 2019
  6. jklymak commented on Jul 2, 2019

    @jklymak
    Member
  7. anntzer commented on Jul 2, 2019

    @anntzer
    Contributor

    oops, see #14677.

  8. ImportanceOfBeingErnest commented on Aug 1, 2019

    @ImportanceOfBeingErnest
    Member

    There are by now 5 6 issues (including this) and 13 questions on stackoverflow within less than a month about this. Is there any plan to release 3.1.2 anytime soon?

  9. QuLogic commented on Aug 1, 2019

    @QuLogic
    Member

    @ivanov was in charge of releasing 3.1.1, but I'm not sure if he's doing 3.1.2. @tacaswell?

  10. talhakabakus commented on Aug 15, 2019

    @talhakabakus

    Same here, hopefully, 3.1.2 will be released as soon as possible as I am not satisfied with the idea of reverting back to 3.1.0. Any news regarding the release?

  11. jklymak commented on Aug 15, 2019

    @jklymak
    Member

    It’s slated for sometime in September. You can use master if you need this urgently and don’t want to roll back.

  12. talhakabakus commented on Aug 15, 2019

    @talhakabakus

    It’s slated for sometime in September. You can use master if you need this urgently and don’t want to roll back.

    Thanks for the feedback.

  13. davidyakobovitch commented on Oct 18, 2019

    @davidyakobovitch

    I have logged this issue with our students and clients, and this is consistent and still exists. Is there an update on this? Is this update in the new release candidate for 3.2.0? https://github.com/matplotlib/matplotlib/releases/tag/v3.2.0rc1

    I can confirm that a downgrade to matplotlib=3.1.0 does resolve this issue for now.

  14. jklymak commented on Oct 18, 2019

    @jklymak
    Member

    Yes, its in the newly tagged release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Release criticalFor bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions.

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions