Search code examples
matplotlibpython-3.5python-3.6fedora-25

export matplotlib setup 1.5 to 2.0


I have moved to Fedora 25 to Fedora 26(Linux, just for the information). In the process there are some changes in matplotlib as well.

In Fedora 25:

  • python3-3.5.3-4.fc25.x86_64
  • python3-matplotlib-1.5.2-0.2.rc2.fc25.x86_64
  • enter image description here

In Fedora 26:

  • python3-3.6.0-22.fc26.x86_64
  • python3-matplotlib-2.0.0-2.fc26.2.x86_64
  • enter image description here

The code to create these two image is same (just copied from one machine to another.). You can see that

  • colors have changed
  • label's font is bigger in matplotlib-2
  • tics are outside (I know how to change it)
  • there is no tics in top and right (I don't know how to change it in matplotlibrc)
  • worst of all, spaces between points has changed (tight is tighter now)

I understand those changes are due to changes in matplotlib style. Is there any way to export all the configurations from matplotlib 1.5 to matplotlib-2, which will yield exact figure?


Solution

  • Try:

    mpl.style.use('classic')
    

    at the top.

    This is mentioned at the official site here (within the introduction)

    (Of course you could also downgrade your matplotlib. The question then is if there is a ready binary in fedora's packages or if you would need pip install; on a linux system, the latter should not hurt too much in terms of install-pain)