Skip to content

Issue with Seaborn and log plots in Python3  #3849

Closed

Description

@jenshnielsen

Not sure if this is a MPL or seaborn issue but just posting it here so that it doesn't get lost. I will investigate further later.

Running the following works as expected in python 2 and using python3 without seaborn on master (1.5.x )

import seaborn
import matplotlib.pyplot as plt


myfig, ax = plt.subplots(1,1)
ax.plot(range(100))
ax.set_xscale('log')
ax.set_yscale('log')
plt.show()

However it doesn't work with python3 see:
https://gist.github.com/jenshnielsen/5292948d67038bb77bfb

Activity

  1. self-assigned this
    on Nov 26, 2014
  2. added this to the milestone on Nov 26, 2014
  3. jenshnielsen commented on Nov 26, 2014

    @jenshnielsen
    MemberAuthor

    From the traceback I guess it relates to the typesetting of exponents with mathtext which is somehow different with seaborn

  4. tacaswell commented on Nov 26, 2014

    @tacaswell
    Member

    Try nuking your fontcache. My knee-jerk reaction is that this is related to the unicode bug that showed up on osx which lead to finding rcparams.update was not validating. If you have not regenerated your font cache sense then you may have a mix of encodings in there.

    Also, that is an impressive trace-back.

  5. jenshnielsen commented on Nov 26, 2014

    @jenshnielsen
    MemberAuthor

    Thanks, I think I tried that already but I will investigate further.

    Yest is is a crazily long traceback. It nearly killed the IPython Notebook when I first ran the code.

  6. tacaswell commented on Nov 26, 2014

    @tacaswell
    Member

    attn @mwaskom Did anything with fonts change on master recently?

  7. jenshnielsen commented on Nov 26, 2014

    @jenshnielsen
    MemberAuthor

    My guess is that it is somehow related to #3671 thou that should be fixed.

  8. mwaskom commented on Nov 26, 2014

    @mwaskom

    attn @mwaskom Did anything with fonts change on master recently?

    Nope, don't think I've touched any font stuff since 0.4 or so.

  9. jenshnielsen commented on Nov 26, 2014

    @jenshnielsen
    MemberAuthor

    The issue is very similar to the issue that #3671 fixes. The problem is that the string returned as typeface is not a valid unicode string for the Arial font that Seaborn uses. The issue in #3671 was with CharacterComplement which is a part of the PCLT table too. The only reason Seaborn is involved is because it changes the default font.

    The strange thing here is that according to the MS docs here http://www.microsoft.com/typography/otspec/pclt.htm typeFace should be an ASCII string so it should be safe to cast it directly to unicode. @mdboom do you have any idea if that could sometime not be the case?

    A simple fix would be to turn typeFace into a byte string but I am not sure it is right.

    BTW: I think this is a stock Apple or perhaps MS office font file.

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions