Skip to content

Matplotlib styles bug fix #184

Description

@patrickleonardy

Bug

The seaborn-ticks and seaborn-whitegrid matplotlib styles which were available in matplotlib 3.4.* are not available since matplotlib 3.6.*, and have been substituted with seaborn-v0_8-ticks and seaborn-v0_8-whitegrid respectively.

The problem is that cobra requirements.txt asks for matplotlib>=3.4.3, which can create the issue if the matplotlib version installed is actually greater than 3.5.* (last version supporting the seaborn-ticks plot style).

Task Description

You can check yourselves in the style files that are linked here below from the matplotlib GitHub repo:

v2.2.* and v3.5.* versus
v3.6.* and v3.8.* (latest)

Regarding Cobra, the files where these styles are used are:

  • ./cobra/evaluation/plotting_utils.py
  • ./cobra/evaluation/pigs_tables.py
  • ./cobra/evaluation/evaluator.py

Solution:

Found where they mention the change in the Matplotlib changelog: https://matplotlib.org/stable/api/prev_api_changes/api_changes_3.6.0.html#seaborn-styles-renamed

matplotlib's team advise is to take the style directly from the seaborn package. Therefore, the solution for the long run should probably not be neither 2 nor 3, although I proposed them haha.

Activity

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

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions