Skip to content

\overline and subscripts/superscripts in mathtext #5444

Closed

Description

@breedlun

The following code works fine in matplotlib 1.4.3, but it fails in matplotlib 1.5.0.

import matplotlib.pyplot as plt
ax = plt.subplot(111)
ax.plot([0,1],[0,1])
ax.text(0.5, 0.5, r'$\overline{\omega}$')
ax.text(0.5, 0.6, r'$\overline{\omega}^x$')
ax.text(0.5, 0.4, r'$\overline{\omega}_x$')

The traceback is super long, but here is the last line.

File "/Users/Ben/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/matplotlib/mathtext.py", line 2809, in subsuper
  last_char.width = last_char._metrics.advance
AttributeError: 'Vlist' object has no attribute '_metrics'

Activity

  1. QuLogic commented on Nov 8, 2015

    @QuLogic
    Member

    Bisect points to c56e56e in #4873:

    commit c56e56edfd880b9980a72a840da56dc4b958c9ba
    Author: Víctor Zabalza <>
    Date:   Sat Aug 8 21:10:44 2015 +0100
    
        improve integral and slanted nuclei placement
    
        clean up, remove unnecesary do_kern=False
    
        fix overunder
    
        make cm clearer at small sizes
    
    :040000 040000 ae8dcc2837d034b327c80473543c026b8815cfc9 44fd9df88d3835179736217a9145167a519f6dc6 M  lib
    

    CC @zblz

  2. added this to the milestone on Nov 9, 2015
  3. added a commit that references this issue on Nov 9, 2015
    f83daa7
  4. zblz commented on Nov 9, 2015

    @zblz
    Member

    Well, that's embarrassing. We were definitely missing a test for a Vlist or Hlist as last character of the subsuper nucleus. I have added a fix against master in #5448, but should definitely be backported to 1.5.x.

  5. mdboom commented on Nov 9, 2015

    @mdboom
    Member

    No worries. The only people who never break code are people who never submit code ;) Thanks for the quick fix.

  6. added a commit that references this issue on Nov 9, 2015
    838502e
  7. added a commit that references this issue on Nov 9, 2015
    7132283
  8. breedlun commented on Nov 9, 2015

    @breedlun
    ContributorAuthor

    Slam, bam, thank you mam! That was a quick turn-around.

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